Skip to content

Instantly share code, notes, and snippets.

View jbaek7023's full-sized avatar
👨‍💻

Jae-Min Baek jbaek7023

👨‍💻
  • Google
  • San Francisco Bay Area
View GitHub Profile
@venkatesh22
venkatesh22 / django custom signal
Created June 26, 2013 05:37
django custom signals creation example
#signals.py
from django.dispatch import Signal
user_login = Signal(providing_args=["request", "user"])
#views.py
from foo import signals
@jacobian
jacobian / models.py
Created February 15, 2011 18:11
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):