Adds rank field to edition model

This commit is contained in:
Mouse Reeve 2021-01-11 09:18:40 -08:00
parent 7e2460955d
commit b44b42be7e
2 changed files with 20 additions and 0 deletions

View file

@ -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),
),
]

View file

@ -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'