mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-18 07:33:57 +00:00
Adds reading status field to book statuses
This commit is contained in:
parent
1e1bf83201
commit
2d20fa4146
2 changed files with 67 additions and 0 deletions
56
bookwyrm/migrations/0083_auto_20210816_2022.py
Normal file
56
bookwyrm/migrations/0083_auto_20210816_2022.py
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Generated by Django 3.2.4 on 2021-08-16 20:22
|
||||
|
||||
import bookwyrm.models.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0082_auto_20210806_2324"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="comment",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "Toread"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="quotation",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "Toread"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="review",
|
||||
name="reading_status",
|
||||
field=bookwyrm.models.fields.CharField(
|
||||
blank=True,
|
||||
choices=[
|
||||
("to-read", "Toread"),
|
||||
("reading", "Reading"),
|
||||
("read", "Read"),
|
||||
],
|
||||
max_length=255,
|
||||
null=True,
|
||||
),
|
||||
),
|
||||
]
|
|
@ -235,6 +235,11 @@ class GeneratedNote(Status):
|
|||
pure_type = "Note"
|
||||
|
||||
|
||||
ReadingStatusChoices = models.TextChoices(
|
||||
"ReadingStatusChoices", ["to-read", "reading", "read"]
|
||||
)
|
||||
|
||||
|
||||
class BookStatus(Status):
|
||||
"""Shared fields for comments, quotes, reviews"""
|
||||
|
||||
|
@ -243,7 +248,13 @@ class BookStatus(Status):
|
|||
)
|
||||
pure_type = "Note"
|
||||
|
||||
reading_status = fields.CharField(
|
||||
max_length=255, choices=ReadingStatusChoices.choices, null=True, blank=True
|
||||
)
|
||||
|
||||
class Meta:
|
||||
"""not a real model, sorry"""
|
||||
|
||||
abstract = True
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue