1 # -*- coding: utf-8 -*-
3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
6 from django.conf import settings
8 class Migration(DataMigration):
10 def forwards(self, orm):
11 "Write your forwards methods here."
12 # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
13 for t in orm.Tag.objects.filter(category__in=('author', 'epoch', 'genre', 'kind', 'theme')):
14 setattr(t, "name_%s" % settings.LANGUAGE_CODE, t.name)
16 orm.Book.objects.all().update(_related_info=None)
18 def backwards(self, orm):
19 "Write your backwards methods here."
20 orm.Book.objects.all().update(_related_info=None)
25 'Meta': {'object_name': 'Group'},
26 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
27 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
28 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
31 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
32 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
33 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
34 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
35 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
38 'Meta': {'object_name': 'User'},
39 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
40 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
41 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
42 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
43 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
44 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
45 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
46 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
47 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
48 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
49 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
50 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
51 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
54 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'},
55 '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}),
56 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
57 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}),
58 'cover': ('catalogue.fields.EbookField', [], {'max_length': '100', 'null': 'True', 'format_name': "'cover'", 'blank': 'True'}),
59 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
60 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
61 'epub_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'epub'", 'blank': 'True'}),
62 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
63 'fb2_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'fb2'", 'blank': 'True'}),
64 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
65 'html_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'html'", 'blank': 'True'}),
66 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
67 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}),
68 'mobi_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'mobi'", 'blank': 'True'}),
69 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
70 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
71 'pdf_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'pdf'", 'blank': 'True'}),
72 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}),
73 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
74 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
75 'txt_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'txt'", 'blank': 'True'}),
76 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
77 'xml_file': ('catalogue.fields.EbookField', [], {'default': "''", 'max_length': '100', 'format_name': "'xml'", 'blank': 'True'})
79 'catalogue.bookmedia': {
80 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
81 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
82 'extra_info': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
83 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
84 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
85 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
86 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
87 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'db_index': 'True'}),
88 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'})
90 'catalogue.collection': {
91 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'},
92 'book_slugs': ('django.db.models.fields.TextField', [], {}),
93 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
94 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True'}),
95 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'})
97 'catalogue.fragment': {
98 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
99 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
100 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
101 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
102 'short_text': ('django.db.models.fields.TextField', [], {}),
103 'text': ('django.db.models.fields.TextField', [], {})
106 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
107 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
108 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
109 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
110 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
111 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
112 'description_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
113 'description_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
114 'description_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
115 'description_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
116 'description_it': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
117 'description_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
118 'description_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
119 'description_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
120 'description_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}),
121 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
122 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
123 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
124 'name_de': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
125 'name_en': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
126 'name_es': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
127 'name_fr': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
128 'name_it': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
129 'name_lt': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
130 'name_pl': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
131 'name_ru': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
132 'name_uk': ('django.db.models.fields.CharField', [], {'blank': True, 'max_length': '50', 'null': True, 'db_index': 'True'}),
133 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}),
134 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
135 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}),
136 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
138 'catalogue.tagrelation': {
139 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "u'catalogue_tag_relation'"},
140 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
141 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
143 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
145 u'contenttypes.contenttype': {
146 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
147 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
148 u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
149 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
150 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
154 complete_apps = ['catalogue']