1 from django.db import models, migrations
2 import django.db.models.deletion
3 import fnpdjango.storage
4 import jsonfield.fields
5 import catalogue.fields
6 import catalogue.models.bookmedia
7 from django.conf import settings
8 import catalogue.models.book
11 class Migration(migrations.Migration):
14 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
15 ('contenttypes', '0001_initial'),
19 migrations.CreateModel(
22 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
23 ('title', models.CharField(max_length=120, verbose_name='Title')),
24 ('sort_key', models.CharField(verbose_name='Sort key', max_length=120, editable=False, db_index=True)),
25 ('sort_key_author', models.CharField(default='', verbose_name='sort key by author', max_length=120, editable=False, db_index=True)),
26 ('slug', models.SlugField(unique=True, max_length=120, verbose_name='Slug')),
27 ('common_slug', models.SlugField(max_length=120, verbose_name='Slug')),
28 ('language', models.CharField(default='pol', max_length=3, verbose_name='language code', db_index=True)),
29 ('description', models.TextField(verbose_name='Description', blank=True)),
30 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
31 ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)),
32 ('parent_number', models.IntegerField(default=0, verbose_name='Parent number')),
33 ('extra_info', jsonfield.fields.JSONField(default={}, verbose_name='Additional information')),
34 ('gazeta_link', models.CharField(max_length=240, blank=True)),
35 ('wiki_link', models.CharField(max_length=240, blank=True)),
36 ('cover', catalogue.fields.EbookField('cover', upload_to=catalogue.models.book._cover_upload_to, storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, null=True, verbose_name='cover')),
37 ('cover_thumb', catalogue.fields.EbookField('cover_thumb', max_length=255, upload_to=catalogue.models.book._cover_thumb_upload_to, null=True, verbose_name='cover thumbnail', blank=True)),
38 ('_related_info', jsonfield.fields.JSONField(null=True, editable=False, blank=True)),
39 ('txt_file', catalogue.fields.EbookField('txt', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._txt_upload_to, max_length=255, blank=True, verbose_name='TXT file')),
40 ('fb2_file', catalogue.fields.EbookField('fb2', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._fb2_upload_to, max_length=255, blank=True, verbose_name='FB2 file')),
41 ('pdf_file', catalogue.fields.EbookField('pdf', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._pdf_upload_to, max_length=255, blank=True, verbose_name='PDF file')),
42 ('epub_file', catalogue.fields.EbookField('epub', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._epub_upload_to, max_length=255, blank=True, verbose_name='EPUB file')),
43 ('mobi_file', catalogue.fields.EbookField('mobi', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._mobi_upload_to, max_length=255, blank=True, verbose_name='MOBI file')),
44 ('html_file', catalogue.fields.EbookField('html', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._html_upload_to, max_length=255, blank=True, verbose_name='HTML file')),
45 ('xml_file', catalogue.fields.EbookField('xml', default='', storage=fnpdjango.storage.BofhFileSystemStorage(), upload_to=catalogue.models.book._xml_upload_to, max_length=255, blank=True, verbose_name='XML file')),
46 ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='children', blank=True, to='catalogue.Book', null=True)),
49 'ordering': ('sort_key',),
50 'verbose_name': 'book',
51 'verbose_name_plural': 'Books',
53 bases=(models.Model,),
55 migrations.CreateModel(
58 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
59 ('type', models.CharField(db_index=True, max_length=20, verbose_name='type', choices=[('mp3', 'MP3 file'), ('ogg', 'Ogg Vorbis file'), ('daisy', 'DAISY file')])),
60 ('name', models.CharField(max_length=512, verbose_name='name')),
61 ('file', catalogue.fields.OverwritingFileField(upload_to=catalogue.models.bookmedia._file_upload_to, max_length=600, verbose_name='XML file')),
62 ('uploaded_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
63 ('extra_info', jsonfield.fields.JSONField(default={}, verbose_name='Additional information', editable=False)),
64 ('source_sha1', models.CharField(max_length=40, null=True, editable=False, blank=True)),
65 ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='media', to='catalogue.Book')),
68 'ordering': ('type', 'name'),
69 'verbose_name': 'book media',
70 'verbose_name_plural': 'book media',
72 bases=(models.Model,),
74 migrations.CreateModel(
77 ('title', models.CharField(max_length=120, verbose_name='Title', db_index=True)),
78 ('title_de', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
79 ('title_en', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
80 ('title_es', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
81 ('title_fr', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
82 ('title_it', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
83 ('title_lt', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
84 ('title_pl', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
85 ('title_ru', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
86 ('title_uk', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
87 ('slug', models.SlugField(max_length=120, serialize=False, verbose_name='Slug', primary_key=True)),
88 ('description', models.TextField(null=True, verbose_name='Description', blank=True)),
89 ('description_de', models.TextField(null=True, verbose_name='Description', blank=True)),
90 ('description_en', models.TextField(null=True, verbose_name='Description', blank=True)),
91 ('description_es', models.TextField(null=True, verbose_name='Description', blank=True)),
92 ('description_fr', models.TextField(null=True, verbose_name='Description', blank=True)),
93 ('description_it', models.TextField(null=True, verbose_name='Description', blank=True)),
94 ('description_lt', models.TextField(null=True, verbose_name='Description', blank=True)),
95 ('description_pl', models.TextField(null=True, verbose_name='Description', blank=True)),
96 ('description_ru', models.TextField(null=True, verbose_name='Description', blank=True)),
97 ('description_uk', models.TextField(null=True, verbose_name='Description', blank=True)),
98 ('book_slugs', models.TextField(verbose_name='Book stubs')),
99 ('kind', models.CharField(default='book', max_length=10, verbose_name='form', db_index=True, choices=[('book', 'book'), ('picture', 'picture')])),
102 'ordering': ('title',),
103 'verbose_name': 'collection',
104 'verbose_name_plural': 'collections',
106 bases=(models.Model,),
108 migrations.CreateModel(
111 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
112 ('text', models.TextField()),
113 ('short_text', models.TextField(editable=False)),
114 ('anchor', models.CharField(max_length=120)),
115 ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fragments', to='catalogue.Book')),
118 'ordering': ('book', 'anchor'),
119 'verbose_name': 'Fragment',
120 'verbose_name_plural': 'Fragments',
122 bases=(models.Model,),
124 migrations.CreateModel(
127 ('netloc', models.CharField(max_length=120, serialize=False, verbose_name='network location', primary_key=True)),
128 ('name', models.CharField(max_length=120, verbose_name='name', blank=True)),
129 ('name_de', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
130 ('name_en', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
131 ('name_es', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
132 ('name_fr', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
133 ('name_it', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
134 ('name_lt', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
135 ('name_pl', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
136 ('name_ru', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
137 ('name_uk', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
140 'ordering': ('netloc',),
141 'verbose_name': 'source',
142 'verbose_name_plural': 'sources',
144 bases=(models.Model,),
146 migrations.CreateModel(
149 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
150 ('name', models.CharField(max_length=50, verbose_name='name', db_index=True)),
151 ('name_de', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
152 ('name_en', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
153 ('name_es', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
154 ('name_fr', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
155 ('name_it', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
156 ('name_lt', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
157 ('name_pl', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
158 ('name_ru', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
159 ('name_uk', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
160 ('slug', models.SlugField(max_length=120, verbose_name='Slug')),
161 ('sort_key', models.CharField(max_length=120, verbose_name='Sort key', db_index=True)),
162 ('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')])),
163 ('description', models.TextField(verbose_name='Description', blank=True)),
164 ('description_de', models.TextField(null=True, verbose_name='Description', blank=True)),
165 ('description_en', models.TextField(null=True, verbose_name='Description', blank=True)),
166 ('description_es', models.TextField(null=True, verbose_name='Description', blank=True)),
167 ('description_fr', models.TextField(null=True, verbose_name='Description', blank=True)),
168 ('description_it', models.TextField(null=True, verbose_name='Description', blank=True)),
169 ('description_lt', models.TextField(null=True, verbose_name='Description', blank=True)),
170 ('description_pl', models.TextField(null=True, verbose_name='Description', blank=True)),
171 ('description_ru', models.TextField(null=True, verbose_name='Description', blank=True)),
172 ('description_uk', models.TextField(null=True, verbose_name='Description', blank=True)),
173 ('book_count', models.IntegerField(null=True, verbose_name='Number of books', blank=True)),
174 ('picture_count', models.IntegerField(null=True, verbose_name='picture count', blank=True)),
175 ('gazeta_link', models.CharField(max_length=240, blank=True)),
176 ('culturepl_link', models.CharField(max_length=240, blank=True)),
177 ('wiki_link', models.CharField(max_length=240, blank=True)),
178 ('wiki_link_de', models.CharField(max_length=240, null=True, blank=True)),
179 ('wiki_link_en', models.CharField(max_length=240, null=True, blank=True)),
180 ('wiki_link_es', models.CharField(max_length=240, null=True, blank=True)),
181 ('wiki_link_fr', models.CharField(max_length=240, null=True, blank=True)),
182 ('wiki_link_it', models.CharField(max_length=240, null=True, blank=True)),
183 ('wiki_link_lt', models.CharField(max_length=240, null=True, blank=True)),
184 ('wiki_link_pl', models.CharField(max_length=240, null=True, blank=True)),
185 ('wiki_link_ru', models.CharField(max_length=240, null=True, blank=True)),
186 ('wiki_link_uk', models.CharField(max_length=240, null=True, blank=True)),
187 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
188 ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)),
189 ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, blank=True, to=settings.AUTH_USER_MODEL, null=True)),
192 'ordering': ('sort_key',),
193 'verbose_name': 'tag',
194 'verbose_name_plural': 'tags',
196 bases=(models.Model,),
198 migrations.CreateModel(
201 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
202 ('object_id', models.PositiveIntegerField(verbose_name='object id', db_index=True)),
203 ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, verbose_name='content type', to='contenttypes.ContentType')),
204 ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', verbose_name='tag', to='catalogue.Tag')),
207 'db_table': 'catalogue_tag_relation',
209 bases=(models.Model,),
211 migrations.AlterUniqueTogether(
213 unique_together=set([('tag', 'content_type', 'object_id')]),
215 migrations.AlterUniqueTogether(
217 unique_together=set([('slug', 'category')]),