mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 18:46:53 +00:00
Merge pull request #77
* added timestamp to comicstatus. * added timestamp to comicstatus.
This commit is contained in:
1 parent
01e73cc9b3
commit
2647a0e31e
20 files changed
+463
-304
No files matched your search
@@ -0,0 +1,22 @@
|
||||
# Generated by Django 4.0.7 on 2022-09-15 09:59
|
||||
|
||||
from django.db import migrations
|
||||
from django.db.models import Count
|
||||
|
||||
|
||||
def forwards_func(apps, schema_editor):
|
||||
books = apps.get_model("comic", "ComicBook")
|
||||
for book in books.objects.all().annotate(total_pages=Count('comicpage')):
|
||||
book.page_count = book.total_pages
|
||||
book.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('comic', '0048_comicbook_page_count'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(forwards_func),
|
||||
]
|
||||
Reference in new issue
Block a user