update group and list models

- remove GroupList model
- add a group foreign key value  to List model
- remove reference to lists in Group model
This commit is contained in:
Hugh Rundle
2021-09-26 15:50:15 +10:00
parent ec0720514e
commit 686198472d
3 changed files with 8 additions and 15 deletions

View File

@ -16,14 +16,6 @@ class Group(BookWyrmModel):
"User", on_delete=models.PROTECT)
description = fields.TextField(blank=True, null=True)
privacy = fields.PrivacyField()
lists = models.ManyToManyField(
"List",
symmetrical=False,
through="GroupList",
through_fields=("group", "book_list"),
)
members = models.ManyToManyField(
"User",
symmetrical=False,
@ -32,12 +24,6 @@ class Group(BookWyrmModel):
related_name="members"
)
class GroupList(BookWyrmModel):
"""Lists that group members can edit"""
group = models.ForeignKey("Group", on_delete=models.CASCADE)
book_list = models.ForeignKey("List", on_delete=models.CASCADE)
class GroupMember(models.Model):
"""Users who are members of a group"""