From eca0ff371cb1596bfa6cb491b253c8e9e693d5bc Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 23 Aug 2021 11:19:15 -0700 Subject: [PATCH] Adds saved lists many to many field --- bookwyrm/migrations/0085_user_saved_lists.py | 20 ++++++++++++++++++++ bookwyrm/models/user.py | 3 +++ 2 files changed, 23 insertions(+) create mode 100644 bookwyrm/migrations/0085_user_saved_lists.py diff --git a/bookwyrm/migrations/0085_user_saved_lists.py b/bookwyrm/migrations/0085_user_saved_lists.py new file mode 100644 index 000000000..d4d9278c5 --- /dev/null +++ b/bookwyrm/migrations/0085_user_saved_lists.py @@ -0,0 +1,20 @@ +# Generated by Django 3.2.4 on 2021-08-23 18:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0084_auto_20210817_1916"), + ] + + operations = [ + migrations.AddField( + model_name="user", + name="saved_lists", + field=models.ManyToManyField( + related_name="saved_lists", to="bookwyrm.List" + ), + ), + ] diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index e10bcd293..0ef23d3f0 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -104,6 +104,9 @@ class User(OrderedCollectionPageMixin, AbstractUser): through_fields=("user_subject", "user_object"), related_name="blocked_by", ) + saved_lists = models.ManyToManyField( + "List", symmetrical=False, related_name="saved_lists" + ) favorites = models.ManyToManyField( "Status", symmetrical=False,