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

@ -1,4 +1,5 @@
""" make a list of books!! """
from dataclasses import field
from django.apps import apps
from django.db import models
from django.utils import timezone
@ -16,6 +17,7 @@ CurationType = models.TextChoices(
"closed",
"open",
"curated",
"group"
],
)
@ -32,6 +34,11 @@ class List(OrderedCollectionMixin, BookWyrmModel):
curation = fields.CharField(
max_length=255, default="closed", choices=CurationType.choices
)
group = models.ForeignKey(
"Group",
on_delete=models.CASCADE,
null=True
)
books = models.ManyToManyField(
"Edition",
symmetrical=False,