3 from south.db import db
4 from south.v2 import SchemaMigration
5 from django.db import models
7 class Migration(SchemaMigration):
9 def forwards(self, orm):
11 # Adding model 'Collection'
12 db.create_table('catalogue_collection', (
13 ('title', self.gf('django.db.models.fields.CharField')(max_length=120, db_index=True)),
14 ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, primary_key=True, db_index=True)),
15 ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
16 ('book_slugs', self.gf('django.db.models.fields.TextField')()),
18 db.send_create_signal('catalogue', ['Collection'])
21 from django.core.management import call_command
22 call_command("loaddata", "collection-boy.json")
24 def backwards(self, orm):
26 # Deleting model 'Collection'
27 db.delete_table('catalogue_collection')
32 'Meta': {'object_name': 'Group'},
33 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
34 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
35 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
38 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
39 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
40 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
41 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
45 'Meta': {'object_name': 'User'},
46 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
47 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
48 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
49 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
50 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
51 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
52 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
53 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
54 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
55 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
56 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
57 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
58 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
61 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'},
62 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
63 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
64 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
65 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
66 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
67 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
68 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
69 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
71 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
72 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
73 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
74 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
75 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
76 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
77 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
78 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
79 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
81 'catalogue.bookmedia': {
82 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
83 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
84 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
85 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
86 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
87 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
88 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
89 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
90 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
92 'catalogue.collection': {
93 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'},
94 'book_slugs': ('django.db.models.fields.TextField', [], {}),
95 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
96 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True', 'db_index': 'True'}),
97 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'})
99 'catalogue.filerecord': {
100 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'},
101 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
102 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
103 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
104 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
105 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'})
107 'catalogue.fragment': {
108 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
109 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
110 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
111 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
112 'short_text': ('django.db.models.fields.TextField', [], {}),
113 'text': ('django.db.models.fields.TextField', [], {})
116 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
117 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
118 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
119 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
120 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
121 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
122 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
123 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
124 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
125 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
126 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
127 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
128 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
129 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
131 'catalogue.tagrelation': {
132 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
133 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
134 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
135 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
136 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
138 'contenttypes.contenttype': {
139 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
140 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
141 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
143 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
147 complete_apps = ['catalogue']