mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 06:17:17 +00:00
Merge pull request #77
* added timestamp to comicstatus. * added timestamp to comicstatus.
This commit is contained in:
18
comic/migrations/0047_comicstatus_updated.py
Normal file
18
comic/migrations/0047_comicstatus_updated.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.0.7 on 2022-09-15 09:52
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('comic', '0046_comicbook_one_comic_name_per_directory'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='comicstatus',
|
||||
name='updated',
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
),
|
||||
]
|
||||
18
comic/migrations/0048_comicbook_page_count.py
Normal file
18
comic/migrations/0048_comicbook_page_count.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.0.7 on 2022-09-15 09:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('comic', '0047_comicstatus_updated'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='comicbook',
|
||||
name='page_count',
|
||||
field=models.IntegerField(default=0),
|
||||
),
|
||||
]
|
||||
22
comic/migrations/0049_populate_pages.py
Normal file
22
comic/migrations/0049_populate_pages.py
Normal file
@@ -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),
|
||||
]
|
||||
16
comic/migrations/0050_delete_comicpage.py
Normal file
16
comic/migrations/0050_delete_comicpage.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Generated by Django 4.0.7 on 2022-09-15 15:17
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('comic', '0049_populate_pages'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.DeleteModel(
|
||||
name='ComicPage',
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user