1 # -*- coding: utf-8 -*-
3 from south.db import db
4 from south.v2 import DataMigration
5 from django.db import models
6 from sortify import sortify
9 class Migration(DataMigration):
11 def forwards(self, orm):
12 "Write your forwards methods here."
13 for theme in orm.Tag.objects.filter(category='theme'):
14 theme.sort_key = sortify(theme.sort_key)
17 def backwards(self, orm):
18 "Write your backwards methods here."
23 'Meta': {'object_name': 'Group'},
24 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
25 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
26 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
29 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
30 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
31 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
32 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
33 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
36 'Meta': {'object_name': 'User'},
37 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
38 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
39 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
40 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
41 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
43 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
44 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
45 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
46 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
47 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
48 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
49 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
52 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'},
53 '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}),
54 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
55 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}),
56 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
57 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
58 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
59 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
60 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}),
61 'fb2_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
62 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
63 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
64 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}),
66 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
67 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
68 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
69 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
70 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120'}),
71 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
72 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
73 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
74 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
75 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
77 'catalogue.bookmedia': {
78 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
79 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
80 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}),
81 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
82 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
84 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
85 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
86 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
88 'catalogue.collection': {
89 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'},
90 'book_slugs': ('django.db.models.fields.TextField', [], {}),
91 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
92 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True'}),
93 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'})
95 'catalogue.fragment': {
96 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
97 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
98 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
99 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
100 'short_text': ('django.db.models.fields.TextField', [], {}),
101 'text': ('django.db.models.fields.TextField', [], {})
104 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
105 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
106 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
107 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
108 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
109 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
110 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
111 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
113 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120'}),
114 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
115 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
116 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
118 'catalogue.tagrelation': {
119 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
120 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
121 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
123 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
125 'contenttypes.contenttype': {
126 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
127 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
128 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
129 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
130 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
134 complete_apps = ['catalogue']