1
0
Fork 0

Merge pull request #1934 from tversteeg/partially-read-shelf

Add 'Stopped Reading' shelf
This commit is contained in:
Mouse Reeve 2022-03-16 13:51:15 -07:00 committed by GitHub
commit f2b0b306e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 206 additions and 7 deletions

View file

@ -0,0 +1,77 @@
# Generated by Django 3.2.11 on 2022-02-11 13:19
import bookwyrm.models.fields
from django.db import migrations
def add_shelves(apps, schema_editor):
"""add any superusers to the "admin" group"""
db_alias = schema_editor.connection.alias
shelf_model = apps.get_model("bookwyrm", "Shelf")
users = apps.get_model("bookwyrm", "User")
local_users = users.objects.using(db_alias).filter(local=True)
for user in local_users:
shelf_model.using(db_alias)(
name="Stopped reading",
identifier=Shelf.STOPPED_READING,
user=user,
editable=False,
).save(broadcast=False)
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0133_alter_listitem_notes"),
]
operations = [
migrations.AlterField(
model_name="comment",
name="reading_status",
field=bookwyrm.models.fields.CharField(
blank=True,
choices=[
("to-read", "To-Read"),
("reading", "Reading"),
("read", "Read"),
("stopped-reading", "Stopped-Reading"),
],
max_length=255,
null=True,
),
),
migrations.AlterField(
model_name="quotation",
name="reading_status",
field=bookwyrm.models.fields.CharField(
blank=True,
choices=[
("to-read", "To-Read"),
("reading", "Reading"),
("read", "Read"),
("stopped-reading", "Stopped-Reading"),
],
max_length=255,
null=True,
),
),
migrations.AlterField(
model_name="review",
name="reading_status",
field=bookwyrm.models.fields.CharField(
blank=True,
choices=[
("to-read", "To-Read"),
("reading", "Reading"),
("read", "Read"),
("stopped-reading", "Stopped-Reading"),
],
max_length=255,
null=True,
),
),
migrations.RunPython(add_shelves, reverse_code=migrations.RunPython.noop),
]

View file

@ -0,0 +1,13 @@
# Generated by Django 3.2.12 on 2022-02-25 21:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0134_alter_stopped_reading"),
("bookwyrm", "0141_alter_report_status"),
]
operations = []

View file

@ -0,0 +1,13 @@
# Generated by Django 3.2.12 on 2022-03-12 10:40
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0142_merge_20220225_2103"),
("bookwyrm", "0144_alter_announcement_display_type"),
]
operations = []