1 # -*- coding: utf-8 -*-
3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
7 class Migration(DataMigration):
9 def forwards(self, orm):
10 orm.Book.objects.all().update(cover_thumb=models.F('cover'))
12 def backwards(self, orm):
13 "Write your backwards methods here."
17 'Meta': {'object_name': 'Group'},
18 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
19 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
20 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
23 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
24 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
25 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
26 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
27 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
30 'Meta': {'object_name': 'User'},
31 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
32 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
33 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
34 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
35 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
36 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
37 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
38 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
39 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
40 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
41 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
42 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
43 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
46 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'},
47 '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}),
48 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
49 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}),
50 'cover': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover'", 'blank': 'True'}),
51 'cover_thumb': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover_thumb'", 'blank': 'True'}),
52 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
53 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
54 'epub_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'epub'", 'blank': 'True'}),
55 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
56 'fb2_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'fb2'", 'blank': 'True'}),
57 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
58 'html_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'html'", 'blank': 'True'}),
59 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
60 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}),
61 'mobi_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'mobi'", 'blank': 'True'}),
62 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
63 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
64 'pdf_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'pdf'", 'blank': 'True'}),
65 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}),
66 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
67 'sort_key_author': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '120', 'db_index': 'True'}),
68 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
69 'txt_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'txt'", 'blank': 'True'}),
70 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
71 'xml_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'xml'", 'blank': 'True'})
73 'catalogue.bookmedia': {
74 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
75 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
76 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
77 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
78 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
79 'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
80 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
81 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'db_index': 'True'}),
82 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'})
84 'catalogue.collection': {
85 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'},
86 'book_slugs': ('django.db.models.fields.TextField', [], {}),
87 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
88 'description_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
89 'description_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
90 'description_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
91 'description_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
92 'description_it': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
93 'description_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
94 'description_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
95 'description_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
96 'description_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
97 'kind': ('django.db.models.fields.CharField', [], {'default': "'book'", 'max_length': '10', 'db_index': 'True'}),
98 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True'}),
99 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
100 'title_de': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
101 'title_en': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
102 'title_es': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
103 'title_fr': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
104 'title_it': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
105 'title_lt': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
106 'title_pl': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
107 'title_ru': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'}),
108 'title_uk': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '120', 'null': True, 'db_index': 'True'})
110 'catalogue.fragment': {
111 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
112 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
113 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
114 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
115 'short_text': ('django.db.models.fields.TextField', [], {}),
116 'text': ('django.db.models.fields.TextField', [], {})
119 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
120 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
121 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
122 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
123 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
124 'culturepl_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
125 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
126 'description_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
127 'description_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
128 'description_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
129 'description_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
130 'description_it': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
131 'description_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
132 'description_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
133 'description_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
134 'description_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
135 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
136 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
137 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
138 'name_de': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
139 'name_en': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
140 'name_es': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
141 'name_fr': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
142 'name_it': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
143 'name_lt': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
144 'name_pl': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
145 'name_ru': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
146 'name_uk': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
147 'picture_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
148 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}),
149 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
150 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}),
151 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
152 'wiki_link_de': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
153 'wiki_link_en': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
154 'wiki_link_es': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
155 'wiki_link_fr': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
156 'wiki_link_it': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
157 'wiki_link_lt': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
158 'wiki_link_pl': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
159 'wiki_link_ru': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True}),
160 'wiki_link_uk': ('django.db.models.fields.CharField', [], {'max_length': '240', 'null': True, 'blank': True})
162 'catalogue.tagrelation': {
163 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "u'catalogue_tag_relation'"},
164 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
165 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
166 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
167 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
169 u'contenttypes.contenttype': {
170 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
171 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
172 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
173 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
174 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
178 complete_apps = ['catalogue']