add and remove users from groups
This commit is contained in:
parent
e800106be4
commit
b645d75303
6 changed files with 100 additions and 33 deletions
|
@ -42,4 +42,11 @@ class GroupMember(models.Model):
|
|||
"""Users who are members of a group"""
|
||||
|
||||
group = models.ForeignKey("Group", on_delete=models.CASCADE)
|
||||
user = models.ForeignKey("User", on_delete=models.CASCADE)
|
||||
user = models.ForeignKey("User", on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["group", "user"], name="unique_member"
|
||||
)
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue