Guest User

Untitled

a guest
Aug 16th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class User(BaseModel):
  2. username = models.CharField(max_length=20)
  3. password = models.CharField(max_length=20)
  4. groups = models.ManyToManyField('Group', related_name='groups', db_table='USERS_TO_GROUPS')
  5.  
  6. class Group(BaseModel):
  7. name = models.CharField(max_length=20)
  8. users = ManyToManyField(User, related_name='users', db_table=u'USERS_TO_GROUPS')
Add Comment
Please, Sign In to add comment