716 books can be on multiple shelves, but only on one shelf for reading status

This commit is contained in:
Pablo Barton
2021-03-25 19:57:20 -04:00
parent 4095580ef0
commit daf69d2375
6 changed files with 102 additions and 41 deletions

View File

@ -11,6 +11,12 @@ from . import fields
class Shelf(OrderedCollectionMixin, BookWyrmModel):
""" a list of books owned by a user """
TO_READ = "to-read"
READING = "reading"
READ_FINISHED = "read"
READ_STATUS_IDENTIFIERS = (TO_READ, READING, READ_FINISHED)
name = fields.CharField(max_length=100)
identifier = models.CharField(max_length=100)
user = fields.ForeignKey(