From b44b42be7e9826ee23433994510888f74ad6e7e8 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 11 Jan 2021 09:18:40 -0800 Subject: [PATCH] Adds rank field to edition model --- .../migrations/0035_edition_edition_rank.py | 19 +++++++++++++++++++ bookwyrm/models/book.py | 1 + 2 files changed, 20 insertions(+) create mode 100644 bookwyrm/migrations/0035_edition_edition_rank.py diff --git a/bookwyrm/migrations/0035_edition_edition_rank.py b/bookwyrm/migrations/0035_edition_edition_rank.py new file mode 100644 index 00000000..b0bd51c5 --- /dev/null +++ b/bookwyrm/migrations/0035_edition_edition_rank.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.7 on 2021-01-11 17:18 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('bookwyrm', '0034_importjob_complete'), + ] + + operations = [ + migrations.AddField( + model_name='edition', + name='edition_rank', + field=bookwyrm.models.fields.IntegerField(default=0), + ), + ] diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index 08189510..bfb8f85e 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -164,6 +164,7 @@ class Edition(Book): parent_work = fields.ForeignKey( 'Work', on_delete=models.PROTECT, null=True, related_name='editions', activitypub_field='work') + edition_rank = fields.IntegerField(default=0) activity_serializer = activitypub.Edition name_field = 'title'