Skip to content

Instantly share code, notes, and snippets.

View avukonke's full-sized avatar

Avukonke Peter avukonke

  • The Internet
  • Cape Town, South Africa
View GitHub Profile
@avukonke
avukonke / models.py
Created January 12, 2018 06:29 — forked from jacobian/models.py
An example of using many-to-many "through" to augment m2m relationships. See http://www.quora.com/How-do-you-query-with-a-condition-on-a-ManyToMany-model-in-Django for context.
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people')
class Meta:
ordering = ['name']
def __unicode__(self):
@avukonke
avukonke / app.js
Created January 24, 2014 13:05 — forked from fdietz/app.js
var app = angular.module("MyApp", []);
app.controller("MyCtrl", function($scope) {
$scope.name = "Peter";
$scope.user = {
name: "Parker"
};
});
app.controller("MyNestedCtrl", function($scope) {