1 # This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
4 from django.db import models, migrations
5 import django.db.models.deletion
6 import fnpdjango.storage
7 import catalogue.fields
8 import catalogue.models.bookmedia
9 from django.conf import settings
10 import catalogue.models.book
13 class Migration(migrations.Migration):
16 migrations.swappable_dependency(settings.AUTH_USER_MODEL),
17 ('contenttypes', '0001_initial'),
21 migrations.CreateModel(
24 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
25 ('title', models.CharField(max_length=120, verbose_name='Title')),
26 ('sort_key', models.CharField(verbose_name='Sort key', max_length=120, editable=False, db_index=True)),
27 ('sort_key_author', models.CharField(default='', verbose_name='sort key by author', max_length=120, editable=False, db_index=True)),
28 ('slug', models.SlugField(unique=True, max_length=120, verbose_name='Slug')),
29 ('common_slug', models.SlugField(max_length=120, verbose_name='Slug')),
30 ('language', models.CharField(default='pol', max_length=3, verbose_name='language code', db_index=True)),
31 ('description', models.TextField(verbose_name='Description', blank=True)),
32 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
33 ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)),
34 ('parent_number', models.IntegerField(default=0, verbose_name='Parent number')),
35 ('extra_info', models.TextField(default='{}', verbose_name='Additional information')),
36 ('gazeta_link', models.CharField(max_length=240, blank=True)),
37 ('wiki_link', models.CharField(max_length=240, blank=True)),
38 ('cover', models.FileField(storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, null=True, verbose_name='cover')),
39 ('cover_thumb', models.FileField(max_length=255, null=True, verbose_name='cover thumbnail', blank=True)),
40 ('_related_info', models.TextField(null=True, editable=False, blank=True)),
41 ('txt_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='TXT file')),
42 ('fb2_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='FB2 file')),
43 ('pdf_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='PDF file')),
44 ('epub_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='EPUB file')),
45 ('mobi_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='MOBI file')),
46 ('html_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='HTML file')),
47 ('xml_file', models.FileField(default='', storage=fnpdjango.storage.BofhFileSystemStorage(), max_length=255, blank=True, verbose_name='XML file')),
48 ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='children', blank=True, to='catalogue.Book', null=True)),
51 'ordering': ('sort_key',),
52 'verbose_name': 'book',
53 'verbose_name_plural': 'Books',
55 bases=(models.Model,),
57 migrations.CreateModel(
60 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
61 ('type', models.CharField(db_index=True, max_length=20, verbose_name='type', choices=[('mp3', 'MP3 file'), ('ogg', 'Ogg Vorbis file'), ('daisy', 'DAISY file')])),
62 ('name', models.CharField(max_length=512, verbose_name='name')),
63 ('file', models.FileField(upload_to=catalogue.models.bookmedia._file_upload_to, max_length=600, verbose_name='XML file')),
64 ('uploaded_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
65 ('extra_info', models.TextField(default='{}', verbose_name='Additional information', editable=False)),
66 ('source_sha1', models.CharField(max_length=40, null=True, editable=False, blank=True)),
67 ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='media', to='catalogue.Book')),
70 'ordering': ('type', 'name'),
71 'verbose_name': 'book media',
72 'verbose_name_plural': 'book media',
74 bases=(models.Model,),
76 migrations.CreateModel(
79 ('title', models.CharField(max_length=120, verbose_name='Title', db_index=True)),
80 ('title_de', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
81 ('title_en', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
82 ('title_es', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
83 ('title_fr', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
84 ('title_it', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
85 ('title_lt', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
86 ('title_pl', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
87 ('title_ru', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
88 ('title_uk', models.CharField(max_length=120, null=True, verbose_name='Title', db_index=True)),
89 ('slug', models.SlugField(max_length=120, serialize=False, verbose_name='Slug', primary_key=True)),
90 ('description', models.TextField(null=True, verbose_name='Description', blank=True)),
91 ('description_de', models.TextField(null=True, verbose_name='Description', blank=True)),
92 ('description_en', models.TextField(null=True, verbose_name='Description', blank=True)),
93 ('description_es', models.TextField(null=True, verbose_name='Description', blank=True)),
94 ('description_fr', models.TextField(null=True, verbose_name='Description', blank=True)),
95 ('description_it', models.TextField(null=True, verbose_name='Description', blank=True)),
96 ('description_lt', models.TextField(null=True, verbose_name='Description', blank=True)),
97 ('description_pl', models.TextField(null=True, verbose_name='Description', blank=True)),
98 ('description_ru', models.TextField(null=True, verbose_name='Description', blank=True)),
99 ('description_uk', models.TextField(null=True, verbose_name='Description', blank=True)),
100 ('book_slugs', models.TextField(verbose_name='Book stubs')),
101 ('kind', models.CharField(default='book', max_length=10, verbose_name='form', db_index=True, choices=[('book', 'book'), ('picture', 'picture')])),
104 'ordering': ('title',),
105 'verbose_name': 'collection',
106 'verbose_name_plural': 'collections',
108 bases=(models.Model,),
110 migrations.CreateModel(
113 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
114 ('text', models.TextField()),
115 ('short_text', models.TextField(editable=False)),
116 ('anchor', models.CharField(max_length=120)),
117 ('book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fragments', to='catalogue.Book')),
120 'ordering': ('book', 'anchor'),
121 'verbose_name': 'Fragment',
122 'verbose_name_plural': 'Fragments',
124 bases=(models.Model,),
126 migrations.CreateModel(
129 ('netloc', models.CharField(max_length=120, serialize=False, verbose_name='network location', primary_key=True)),
130 ('name', models.CharField(max_length=120, verbose_name='name', blank=True)),
131 ('name_de', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
132 ('name_en', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
133 ('name_es', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
134 ('name_fr', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
135 ('name_it', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
136 ('name_lt', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
137 ('name_pl', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
138 ('name_ru', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
139 ('name_uk', models.CharField(max_length=120, null=True, verbose_name='name', blank=True)),
142 'ordering': ('netloc',),
143 'verbose_name': 'source',
144 'verbose_name_plural': 'sources',
146 bases=(models.Model,),
148 migrations.CreateModel(
151 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
152 ('name', models.CharField(max_length=50, verbose_name='name', db_index=True)),
153 ('name_de', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
154 ('name_en', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
155 ('name_es', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
156 ('name_fr', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
157 ('name_it', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
158 ('name_lt', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
159 ('name_pl', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
160 ('name_ru', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
161 ('name_uk', models.CharField(max_length=50, null=True, verbose_name='name', db_index=True)),
162 ('slug', models.SlugField(max_length=120, verbose_name='Slug')),
163 ('sort_key', models.CharField(max_length=120, verbose_name='Sort key', db_index=True)),
164 ('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')])),
165 ('description', models.TextField(verbose_name='Description', blank=True)),
166 ('description_de', models.TextField(null=True, verbose_name='Description', blank=True)),
167 ('description_en', models.TextField(null=True, verbose_name='Description', blank=True)),
168 ('description_es', models.TextField(null=True, verbose_name='Description', blank=True)),
169 ('description_fr', models.TextField(null=True, verbose_name='Description', blank=True)),
170 ('description_it', models.TextField(null=True, verbose_name='Description', blank=True)),
171 ('description_lt', models.TextField(null=True, verbose_name='Description', blank=True)),
172 ('description_pl', models.TextField(null=True, verbose_name='Description', blank=True)),
173 ('description_ru', models.TextField(null=True, verbose_name='Description', blank=True)),
174 ('description_uk', models.TextField(null=True, verbose_name='Description', blank=True)),
175 ('book_count', models.IntegerField(null=True, verbose_name='Number of books', blank=True)),
176 ('picture_count', models.IntegerField(null=True, verbose_name='picture count', blank=True)),
177 ('gazeta_link', models.CharField(max_length=240, blank=True)),
178 ('culturepl_link', models.CharField(max_length=240, blank=True)),
179 ('wiki_link', models.CharField(max_length=240, blank=True)),
180 ('wiki_link_de', models.CharField(max_length=240, null=True, blank=True)),
181 ('wiki_link_en', models.CharField(max_length=240, null=True, blank=True)),
182 ('wiki_link_es', models.CharField(max_length=240, null=True, blank=True)),
183 ('wiki_link_fr', models.CharField(max_length=240, null=True, blank=True)),
184 ('wiki_link_it', models.CharField(max_length=240, null=True, blank=True)),
185 ('wiki_link_lt', models.CharField(max_length=240, null=True, blank=True)),
186 ('wiki_link_pl', models.CharField(max_length=240, null=True, blank=True)),
187 ('wiki_link_ru', models.CharField(max_length=240, null=True, blank=True)),
188 ('wiki_link_uk', models.CharField(max_length=240, null=True, blank=True)),
189 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
190 ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)),
191 ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, blank=True, to=settings.AUTH_USER_MODEL, null=True)),
194 'ordering': ('sort_key',),
195 'verbose_name': 'tag',
196 'verbose_name_plural': 'tags',
198 bases=(models.Model,),
200 migrations.CreateModel(
203 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
204 ('object_id', models.PositiveIntegerField(verbose_name='object id', db_index=True)),
205 ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, verbose_name='content type', to='contenttypes.ContentType')),
206 ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', verbose_name='tag', to='catalogue.Tag')),
209 'db_table': 'catalogue_tag_relation',
211 bases=(models.Model,),
213 migrations.AlterUniqueTogether(
215 unique_together=set([('tag', 'content_type', 'object_id')]),
217 migrations.AlterUniqueTogether(
219 unique_together=set([('slug', 'category')]),