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