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