Update edition ranks when work is saved
This commit is contained in:
parent
6db64e33e4
commit
83852e29eb
4 changed files with 26 additions and 1 deletions
|
@ -8,6 +8,7 @@ def set_rank(app_registry, schema_editor):
|
|||
db_alias = schema_editor.connection.alias
|
||||
books = app_registry.get_model('bookwyrm', 'Edition')
|
||||
for book in books.objects.using(db_alias):
|
||||
book.edition_rank = book.get_rank
|
||||
book.save()
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue