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