X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/ae60b2a3949e96357477cc04f90fd0873cee8a92..30ceb98e6272767f8f271ecb0de30858e1c1a88e:/src/catalogue/migrations/0001_initial.py diff --git a/src/catalogue/migrations/0001_initial.py b/src/catalogue/migrations/0001_initial.py index 661fde840..448b8b90d 100644 --- a/src/catalogue/migrations/0001_initial.py +++ b/src/catalogue/migrations/0001_initial.py @@ -1,9 +1,9 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations +import django.db.models.deletion import fnpdjango.storage -import jsonfield.fields import catalogue.fields import catalogue.models.bookmedia from django.conf import settings @@ -27,25 +27,25 @@ class Migration(migrations.Migration): ('sort_key_author', models.CharField(default='', verbose_name='sort key by author', max_length=120, editable=False, db_index=True)), ('slug', models.SlugField(unique=True, max_length=120, verbose_name='Slug')), ('common_slug', models.SlugField(max_length=120, verbose_name='Slug')), - ('language', models.CharField(default=b'pol', max_length=3, verbose_name='language code', db_index=True)), + ('language', models.CharField(default='pol', max_length=3, verbose_name='language code', db_index=True)), ('description', models.TextField(verbose_name='Description', blank=True)), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)), ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)), ('parent_number', models.IntegerField(default=0, verbose_name='Parent number')), - ('extra_info', jsonfield.fields.JSONField(default={}, verbose_name='Additional information')), + ('extra_info', models.TextField(default='{}', verbose_name='Additional information')), ('gazeta_link', models.CharField(max_length=240, blank=True)), ('wiki_link', models.CharField(max_length=240, blank=True)), - ('cover', catalogue.fields.EbookField(b'cover', upload_to=catalogue.models.book._cover_upload_to, storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, null=True, verbose_name='cover')), - ('cover_thumb', catalogue.fields.EbookField(b'cover_thumb', max_length=255, upload_to=catalogue.models.book._cover_thumb_upload_to, null=True, verbose_name='cover thumbnail', blank=True)), - ('_related_info', jsonfield.fields.JSONField(null=True, editable=False, blank=True)), - ('txt_file', catalogue.fields.EbookField(b'txt', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._txt_upload_to, max_length=255, blank=True, verbose_name='TXT file')), - ('fb2_file', catalogue.fields.EbookField(b'fb2', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._fb2_upload_to, max_length=255, blank=True, verbose_name='FB2 file')), - ('pdf_file', catalogue.fields.EbookField(b'pdf', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._pdf_upload_to, max_length=255, blank=True, verbose_name='PDF file')), - ('epub_file', catalogue.fields.EbookField(b'epub', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._epub_upload_to, max_length=255, blank=True, verbose_name='EPUB file')), - ('mobi_file', catalogue.fields.EbookField(b'mobi', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._mobi_upload_to, max_length=255, blank=True, verbose_name='MOBI file')), - ('html_file', catalogue.fields.EbookField(b'html', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._html_upload_to, max_length=255, blank=True, verbose_name='HTML file')), - ('xml_file', catalogue.fields.EbookField(b'xml', default=b'', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._xml_upload_to, max_length=255, blank=True, verbose_name='XML file')), - ('parent', models.ForeignKey(related_name=b'children', blank=True, to='catalogue.Book', null=True)), + ('cover', models.FileField(storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, null=True, verbose_name='cover')), + ('cover_thumb', models.FileField(max_length=255, null=True, verbose_name='cover thumbnail', blank=True)), + ('_related_info', models.TextField(null=True, editable=False, blank=True)), + ('txt_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='TXT file')), + ('fb2_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='FB2 file')), + ('pdf_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='PDF file')), + ('epub_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='EPUB file')), + ('mobi_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='MOBI file')), + ('html_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='HTML file')), + ('xml_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='XML file')), + ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='children', blank=True, to='catalogue.Book', null=True)), ], options={ 'ordering': ('sort_key',), @@ -58,13 +58,13 @@ class Migration(migrations.Migration): name='BookMedia', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), - ('type', models.CharField(db_index=True, max_length=20, verbose_name='type', choices=[(b'mp3', 'MP3 file'), (b'ogg', 'Ogg Vorbis file'), (b'daisy', 'DAISY file')])), + ('type', models.CharField(db_index=True, max_length=20, verbose_name='type', choices=[('mp3', 'MP3 file'), ('ogg', 'Ogg Vorbis file'), ('daisy', 'DAISY file')])), ('name', models.CharField(max_length=512, verbose_name='name')), - ('file', catalogue.fields.OverwritingFileField(upload_to=catalogue.models.bookmedia._file_upload_to, max_length=600, verbose_name='XML file')), + ('file', models.FileField(upload_to=catalogue.models.bookmedia._file_upload_to, max_length=600, verbose_name='XML file')), ('uploaded_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)), - ('extra_info', jsonfield.fields.JSONField(default={}, verbose_name='Additional information', editable=False)), + ('extra_info', models.TextField(default='{}', verbose_name='Additional information', editable=False)), ('source_sha1', models.CharField(max_length=40, null=True, editable=False, blank=True)), - ('book', models.ForeignKey(related_name=b'media', to='catalogue.Book')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='media', to='catalogue.Book')), ], options={ 'ordering': ('type', 'name'), @@ -98,7 +98,7 @@ class Migration(migrations.Migration): ('description_ru', models.TextField(null=True, verbose_name='Description', blank=True)), ('description_uk', models.TextField(null=True, verbose_name='Description', blank=True)), ('book_slugs', models.TextField(verbose_name='Book stubs')), - ('kind', models.CharField(default=b'book', max_length=10, verbose_name='form', db_index=True, choices=[(b'book', 'book'), (b'picture', b'picture')])), + ('kind', models.CharField(default='book', max_length=10, verbose_name='form', db_index=True, choices=[('book', 'book'), ('picture', 'picture')])), ], options={ 'ordering': ('title',), @@ -114,7 +114,7 @@ class Migration(migrations.Migration): ('text', models.TextField()), ('short_text', models.TextField(editable=False)), ('anchor', models.CharField(max_length=120)), - ('book', models.ForeignKey(related_name=b'fragments', to='catalogue.Book')), + ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fragments', to='catalogue.Book')), ], options={ 'ordering': ('book', 'anchor'), @@ -161,7 +161,7 @@ class Migration(migrations.Migration): ('name_uk', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)), ('slug', models.SlugField(max_length=120, verbose_name='Slug')), ('sort_key', models.CharField(max_length=120, verbose_name='Sort key', db_index=True)), - ('category', models.CharField(db_index=True, max_length=50, verbose_name='Category', choices=[(b'author', 'author'), (b'epoch', 'period'), (b'kind', 'form'), (b'genre', 'genre'), (b'theme', 'motif'), (b'set', 'set'), (b'book', 'book'), (b'thing', 'thing')])), + ('category', models.CharField(db_index=True, max_length=50, verbose_name='Category', choices=[('author', 'author'), ('epoch', 'period'), ('kind', 'form'), ('genre', 'genre'), ('theme', 'motif'), ('set', 'set'), ('book', 'book'), ('thing', 'thing')])), ('description', models.TextField(verbose_name='Description', blank=True)), ('description_de', models.TextField(null=True, verbose_name='Description', blank=True)), ('description_en', models.TextField(null=True, verbose_name='Description', blank=True)), @@ -188,7 +188,7 @@ class Migration(migrations.Migration): ('wiki_link_uk', models.CharField(max_length=240, null=True, blank=True)), ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)), ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)), - ('user', models.ForeignKey(blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, blank=True, to=settings.AUTH_USER_MODEL, null=True)), ], options={ 'ordering': ('sort_key',), @@ -202,8 +202,8 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('object_id', models.PositiveIntegerField(verbose_name='object id', db_index=True)), - ('content_type', models.ForeignKey(verbose_name='content type', to='contenttypes.ContentType')), - ('tag', models.ForeignKey(related_name=b'items', verbose_name='tag', to='catalogue.Tag')), + ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, verbose_name='content type', to='contenttypes.ContentType')), + ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', verbose_name='tag', to='catalogue.Tag')), ], options={ 'db_table': 'catalogue_tag_relation',