From dba0aaff2cb5d697cbf6a0da82d984232f84e358 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 28 Sep 2021 16:36:47 -0700 Subject: [PATCH] Adds description field to shelf --- bookwyrm/forms.py | 2 +- bookwyrm/migrations/0100_shelf_description.py | 18 ++++++++++++++++++ bookwyrm/models/shelf.py | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 bookwyrm/migrations/0100_shelf_description.py diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 9b410eaf..5acde9ea 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -268,7 +268,7 @@ class CreateInviteForm(CustomForm): class ShelfForm(CustomForm): class Meta: model = models.Shelf - fields = ["user", "name", "privacy"] + fields = ["user", "name", "privacy", "description"] class GoalForm(CustomForm): diff --git a/bookwyrm/migrations/0100_shelf_description.py b/bookwyrm/migrations/0100_shelf_description.py new file mode 100644 index 00000000..18185b17 --- /dev/null +++ b/bookwyrm/migrations/0100_shelf_description.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-09-28 23:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0099_readthrough_is_active"), + ] + + operations = [ + migrations.AddField( + model_name="shelf", + name="description", + field=models.TextField(blank=True, max_length=500, null=True), + ), + ] diff --git a/bookwyrm/models/shelf.py b/bookwyrm/models/shelf.py index 89ea9471..63645596 100644 --- a/bookwyrm/models/shelf.py +++ b/bookwyrm/models/shelf.py @@ -21,6 +21,7 @@ class Shelf(OrderedCollectionMixin, BookWyrmModel): name = fields.CharField(max_length=100) identifier = models.CharField(max_length=100) + description = models.TextField(blank=True, null=True, max_length=500) user = fields.ForeignKey( "User", on_delete=models.PROTECT, activitypub_field="owner" )