X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ff599b825d16d3e6b1edbf263bba01bdbbf0f11f..53e53be2fd5c6ffd0b96928735944aa75b7b2f2d:/src/catalogue/models/book.py diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 0f664c42d..e5ab5e480 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -465,6 +465,7 @@ class Book(models.Model): child.parent_cover_changed() book.save() # update sort_key_author + book.update_popularity() cls.published.send(sender=cls, instance=book) return book @@ -715,4 +716,4 @@ add_file_fields() class BookPopularity(models.Model): book = models.OneToOneField(Book, related_name='popularity') - count = models.IntegerField(default=0) + count = models.IntegerField(default=0, db_index=True)