Skip to content

Instantly share code, notes, and snippets.

@wess
Created October 18, 2011 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wess/1294462 to your computer and use it in GitHub Desktop.
Save wess/1294462 to your computer and use it in GitHub Desktop.
class User(BaseModel):
username = models.CharField(max_length=20)
password = models.CharField(max_length=20)
groups = models.ManyToManyField('Group', related_name='groups', db_table='USERS_TO_GROUPS')
class Group(BaseModel):
name = models.CharField(max_length=20)
users = ManyToManyField(User, related_name='users', db_table=u'USERS_TO_GROUPS')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment