3105e2ad4e63751cf57a44c5f30989b0f6ecaa32
[wolnelektury.git] / apps / picture / migrations / 0001_initial.py
1 # -*- coding: utf-8 -*-
2 from __future__ import unicode_literals
3
4 from django.db import models, migrations
5 import sorl.thumbnail.fields
6 import jsonfield.fields
7 import django.core.files.storage
8
9
10 class Migration(migrations.Migration):
11
12     dependencies = [
13     ]
14
15     operations = [
16         migrations.CreateModel(
17             name='Picture',
18             fields=[
19                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
20                 ('title', models.CharField(max_length=120, verbose_name='Title')),
21                 ('slug', models.SlugField(unique=True, max_length=120, verbose_name='Slug')),
22                 ('sort_key', models.CharField(verbose_name='Sort key', max_length=120, editable=False, db_index=True)),
23                 ('sort_key_author', models.CharField(default='', verbose_name='sort key by author', max_length=120, editable=False, db_index=True)),
24                 ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='creation date', db_index=True)),
25                 ('changed_at', models.DateTimeField(auto_now=True, verbose_name='creation date', db_index=True)),
26                 ('xml_file', models.FileField(upload_to=b'xml', storage=django.core.files.storage.FileSystemStorage(base_url=b'/media/pictures/', location=b'/home/rczajka/workspace/wolnelektury/media/pictures'), verbose_name=b'xml_file')),
27                 ('image_file', sorl.thumbnail.fields.ImageField(upload_to=b'images', storage=django.core.files.storage.FileSystemStorage(base_url=b'/media/pictures/', location=b'/home/rczajka/workspace/wolnelektury/media/pictures'), verbose_name='image_file')),
28                 ('html_file', models.FileField(upload_to=b'html', storage=django.core.files.storage.FileSystemStorage(base_url=b'/media/pictures/', location=b'/home/rczajka/workspace/wolnelektury/media/pictures'), verbose_name=b'html_file')),
29                 ('areas_json', jsonfield.fields.JSONField(default={}, verbose_name='picture areas JSON', editable=False)),
30                 ('extra_info', jsonfield.fields.JSONField(default={}, verbose_name='Additional information')),
31                 ('culturepl_link', models.CharField(max_length=240, blank=True)),
32                 ('wiki_link', models.CharField(max_length=240, blank=True)),
33                 ('_related_info', jsonfield.fields.JSONField(null=True, editable=False, blank=True)),
34                 ('width', models.IntegerField(null=True)),
35                 ('height', models.IntegerField(null=True)),
36             ],
37             options={
38                 'ordering': ('sort_key',),
39                 'verbose_name': 'picture',
40                 'verbose_name_plural': 'pictures',
41             },
42             bases=(models.Model,),
43         ),
44         migrations.CreateModel(
45             name='PictureArea',
46             fields=[
47                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
48                 ('area', jsonfield.fields.JSONField(default={}, verbose_name='area', editable=False)),
49                 ('kind', models.CharField(db_index=True, max_length=10, verbose_name='form', choices=[(b'thing', 'thing'), (b'theme', 'motif')])),
50                 ('picture', models.ForeignKey(related_name=b'areas', to='picture.Picture')),
51             ],
52             options={
53             },
54             bases=(models.Model,),
55         ),
56     ]