From: Radek Czajka Date: Thu, 29 Mar 2012 17:05:11 +0000 (+0200) Subject: cuts and optimizations X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/0534cba3ab83d0d10e52c2c27eb6387c9763481b?ds=inline;hp=-c cuts and optimizations --- 0534cba3ab83d0d10e52c2c27eb6387c9763481b diff --git a/apps/api/handlers.py b/apps/api/handlers.py index 260384d69..91a3f4bb9 100644 --- a/apps/api/handlers.py +++ b/apps/api/handlers.py @@ -93,11 +93,11 @@ class BookMediaHandler(BaseHandler): @classmethod def artist(cls, media): - return media.get_extra_info_value().get('artist_name', '') + return media.extra_info.get('artist_name', '') @classmethod def director(cls, media): - return media.get_extra_info_value().get('director_name', '') + return media.extra_info.get('director_name', '') @@ -422,7 +422,7 @@ class CatalogueHandler(BaseHandler): else: fields = all_fields - extra_info = book.get_extra_info_value() + extra_info = book.extra_info obj = {} for field in fields: @@ -437,7 +437,7 @@ class CatalogueHandler(BaseHandler): elif field in BookMedia.formats: media = [] - for m in book.media.filter(type=field): + for m in book.media.filter(type=field).iterator(): media.append({ 'url': m.file.url, 'size': m.file.size, @@ -449,10 +449,10 @@ class CatalogueHandler(BaseHandler): obj[field] = book.get_absolute_url() elif field == 'tags': - obj[field] = [t.id for t in book.tags.exclude(category__in=('book', 'set'))] + obj[field] = [t.id for t in book.tags.exclude(category__in=('book', 'set')).iterator()] elif field == 'author': - obj[field] = ", ".join(t.name for t in book.tags.filter(category='author')) + obj[field] = ", ".join(t.name for t in book.tags.filter(category='author').iterator()) elif field == 'parent': obj[field] = book.parent_id @@ -489,7 +489,7 @@ class CatalogueHandler(BaseHandler): last_change = since for book in Book.objects.filter(changed_at__gte=since, - changed_at__lt=until): + changed_at__lt=until).iterator(): book_d = cls.book_dict(book, fields) updated.append(book_d) if updated: @@ -498,7 +498,7 @@ class CatalogueHandler(BaseHandler): for book in Deleted.objects.filter(content_type=Book, deleted_at__gte=since, deleted_at__lt=until, - created_at__lt=since): + created_at__lt=since).iterator(): deleted.append(book.id) if deleted: changes['deleted'] = deleted @@ -524,7 +524,7 @@ class CatalogueHandler(BaseHandler): obj[field] = tag.get_absolute_url() elif field == 'books': - obj[field] = [b.id for b in Book.tagged_top_level([tag])] + obj[field] = [b.id for b in Book.tagged_top_level([tag]).iterator()] elif field == 'sort_key': obj[field] = tag.sort_key @@ -562,7 +562,7 @@ class CatalogueHandler(BaseHandler): for tag in Tag.objects.filter(category__in=categories, changed_at__gte=since, - changed_at__lt=until): + changed_at__lt=until).iterator(): # only serve non-empty tags if tag.book_count: tag_d = cls.tag_dict(tag, fields) @@ -576,7 +576,7 @@ class CatalogueHandler(BaseHandler): content_type=Tag, deleted_at__gte=since, deleted_at__lt=until, - created_at__lt=since): + created_at__lt=since).iterator(): deleted.append(tag.id) if deleted: changes['deleted'] = deleted diff --git a/apps/catalogue/feeds.py b/apps/catalogue/feeds.py index 836202aab..ddbcb1d6a 100644 --- a/apps/catalogue/feeds.py +++ b/apps/catalogue/feeds.py @@ -53,14 +53,14 @@ class AudiobookFeed(Feed): def item_categories(self, item): return sorted(set(author.name for author in - item.book.tags.filter(category='author'))) + item.book.tags.filter(category='author').iterator())) def item_description(self, item): lines = [] - artist = item.get_extra_info_value().get('artist_name', None) + artist = item.extra_info.get('artist_name', None) if artist is not None: lines.append(u'Czyta: %s' % artist) - director = item.get_extra_info_value().get('artist_name', None) + director = item.extra_info.get('artist_name', None) if director is not None: lines.append(u'Reżyseruje: %s' % director) return u'
\n'.join(lines) diff --git a/apps/catalogue/fields.py b/apps/catalogue/fields.py index 390fb0359..5ab78eb03 100644 --- a/apps/catalogue/fields.py +++ b/apps/catalogue/fields.py @@ -2,68 +2,8 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -import datetime - -from django.conf import settings from django.db import models from django.db.models.fields.files import FieldFile -from django import forms -from django.utils import simplejson as json -from django.utils.translation import ugettext_lazy as _ - - -class JSONEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, datetime.datetime): - return obj.strftime('%Y-%m-%d %H:%M:%S') - elif isinstance(obj, datetime.date): - return obj.strftime('%Y-%m-%d') - elif isinstance(obj, datetime.time): - return obj.strftime('%H:%M:%S') - return json.JSONEncoder.default(self, obj) - - -def dumps(data): - return JSONEncoder().encode(data) - - -def loads(str): - return json.loads(str, encoding=settings.DEFAULT_CHARSET) - - -class JSONFormField(forms.CharField): - widget = forms.Textarea - - def clean(self, value): - try: - loads(value) - return value - except ValueError, e: - raise forms.ValidationError(_('Enter a valid JSON value. Error: %s') % e) - - -class JSONField(models.TextField): - def formfield(self, **kwargs): - defaults = {'form_class': JSONFormField} - defaults.update(kwargs) - return super(JSONField, self).formfield(**defaults) - - def db_type(self, connection): - return 'text' - - def get_internal_type(self): - return 'TextField' - - def contribute_to_class(self, cls, name): - super(JSONField, self).contribute_to_class(cls, name) - - def get_value(model_instance): - return loads(getattr(model_instance, self.attname, None)) - setattr(cls, 'get_%s_value' % self.name, get_value) - - def set_value(model_instance, json): - return setattr(model_instance, self.attname, dumps(json)) - setattr(cls, 'set_%s_value' % self.name, set_value) class OverwritingFieldFile(FieldFile): @@ -89,7 +29,6 @@ try: # check for south from south.modelsinspector import add_introspection_rules - add_introspection_rules([], ["^catalogue\.fields\.JSONField"]) add_introspection_rules([], ["^catalogue\.fields\.OverwritingFileField"]) except ImportError: pass diff --git a/apps/catalogue/migrations/0001_initial.py b/apps/catalogue/migrations/0001_initial.py index 045b2f204..38a31e914 100644 --- a/apps/catalogue/migrations/0001_initial.py +++ b/apps/catalogue/migrations/0001_initial.py @@ -13,15 +13,15 @@ class Migration(SchemaMigration): ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('name', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), - ('sort_key', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), + ('sort_key', self.gf('django.db.models.fields.CharField')(max_length=120, db_index=True)), ('category', self.gf('django.db.models.fields.CharField')(max_length=50, db_index=True)), ('description', self.gf('django.db.models.fields.TextField')(blank=True)), - ('main_page', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True)), ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)), - ('book_count', self.gf('django.db.models.fields.IntegerField')(null=True)), - ('death', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), + ('book_count', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), ('gazeta_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)), ('wiki_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)), + ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), + ('changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), )) db.send_create_signal('catalogue', ['Tag']) @@ -40,37 +40,43 @@ class Migration(SchemaMigration): # Adding unique constraint on 'TagRelation', fields ['tag', 'content_type', 'object_id'] db.create_unique('catalogue_tag_relation', ['tag_id', 'content_type_id', 'object_id']) + # Adding model 'BookMedia' + db.create_table('catalogue_bookmedia', ( + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('type', self.gf('django.db.models.fields.CharField')(max_length='100')), + ('name', self.gf('django.db.models.fields.CharField')(max_length='100')), + ('file', self.gf('catalogue.fields.OverwritingFileField')(max_length=100)), + ('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('extra_info', self.gf('jsonfield.fields.JSONField')(default='{}')), + ('book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='media', to=orm['catalogue.Book'])), + ('source_sha1', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True)), + )) + db.send_create_signal('catalogue', ['BookMedia']) + # Adding model 'Book' db.create_table('catalogue_book', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('title', self.gf('django.db.models.fields.CharField')(max_length=120)), + ('sort_key', self.gf('django.db.models.fields.CharField')(max_length=120, db_index=True)), ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)), + ('common_slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), + ('language', self.gf('django.db.models.fields.CharField')(default='pol', max_length=3, db_index=True)), ('description', self.gf('django.db.models.fields.TextField')(blank=True)), - ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - ('_short_html', self.gf('django.db.models.fields.TextField')()), - ('_short_html_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_lt', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_pl', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_ru', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_uk', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), + ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)), + ('changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, db_index=True, blank=True)), ('parent_number', self.gf('django.db.models.fields.IntegerField')(default=0)), - ('extra_info', self.gf('catalogue.fields.JSONField')()), + ('extra_info', self.gf('jsonfield.fields.JSONField')(default='{}')), ('gazeta_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)), ('wiki_link', self.gf('django.db.models.fields.CharField')(max_length=240, blank=True)), - ('xml_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), - ('html_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), + ('cover', self.gf('django.db.models.fields.files.FileField')(max_length=100, null=True, blank=True)), + ('parent', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='children', null=True, to=orm['catalogue.Book'])), + ('_related_info', self.gf('jsonfield.fields.JSONField')(null=True, blank=True)), ('pdf_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), ('epub_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), - ('odt_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), + ('mobi_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), ('txt_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), - ('mp3_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), - ('ogg_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), - ('parent', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='children', null=True, to=orm['catalogue.Book'])), - ('_tag_counter', self.gf('catalogue.fields.JSONField')(null=True)), - ('_theme_counter', self.gf('catalogue.fields.JSONField')(null=True)), + ('html_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), + ('xml_file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), )) db.send_create_signal('catalogue', ['Book']) @@ -79,41 +85,19 @@ class Migration(SchemaMigration): ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('text', self.gf('django.db.models.fields.TextField')()), ('short_text', self.gf('django.db.models.fields.TextField')()), - ('_short_html', self.gf('django.db.models.fields.TextField')()), - ('_short_html_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_lt', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_pl', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_ru', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('_short_html_uk', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), ('anchor', self.gf('django.db.models.fields.CharField')(max_length=120)), ('book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='fragments', to=orm['catalogue.Book'])), )) db.send_create_signal('catalogue', ['Fragment']) - # Adding model 'BookStub' - db.create_table('catalogue_bookstub', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=120)), - ('author', self.gf('django.db.models.fields.CharField')(max_length=120)), - ('pd', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)), - ('translator', self.gf('django.db.models.fields.TextField')(blank=True)), - ('translator_death', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal('catalogue', ['BookStub']) - - # Adding model 'FileRecord' - db.create_table('catalogue_filerecord', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), - ('type', self.gf('django.db.models.fields.CharField')(max_length=20, db_index=True)), - ('sha1', self.gf('django.db.models.fields.CharField')(max_length=40)), - ('time', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + # Adding model 'Collection' + db.create_table('catalogue_collection', ( + ('title', self.gf('django.db.models.fields.CharField')(max_length=120, db_index=True)), + ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, primary_key=True, db_index=True)), + ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), + ('book_slugs', self.gf('django.db.models.fields.TextField')()), )) - db.send_create_signal('catalogue', ['FileRecord']) + db.send_create_signal('catalogue', ['Collection']) def backwards(self, orm): @@ -130,17 +114,17 @@ class Migration(SchemaMigration): # Deleting model 'TagRelation' db.delete_table('catalogue_tag_relation') + # Deleting model 'BookMedia' + db.delete_table('catalogue_bookmedia') + # Deleting model 'Book' db.delete_table('catalogue_book') # Deleting model 'Fragment' db.delete_table('catalogue_fragment') - # Deleting model 'BookStub' - db.delete_table('catalogue_bookstub') - - # Deleting model 'FileRecord' - db.delete_table('catalogue_filerecord') + # Deleting model 'Collection' + db.delete_table('catalogue_collection') models = { @@ -174,66 +158,50 @@ class Migration(SchemaMigration): 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, + '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}), 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), + 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) }, - 'catalogue.bookstub': { - 'Meta': {'ordering': "('title',)", 'object_name': 'BookStub'}, - 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'catalogue.bookmedia': { + 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, + 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}), + 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), + 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), + 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) + 'catalogue.collection': { + 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'}, + 'book_slugs': ('django.db.models.fields.TextField', [], {}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}) }, 'catalogue.fragment': { 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), @@ -242,16 +210,16 @@ class Migration(SchemaMigration): }, 'catalogue.tag': { 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), + 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) }, diff --git a/apps/catalogue/migrations/0002_auto__add_field_book_daisy_file.py b/apps/catalogue/migrations/0002_auto__add_field_book_daisy_file.py deleted file mode 100644 index 8f5c088ed..000000000 --- a/apps/catalogue/migrations/0002_auto__add_field_book_daisy_file.py +++ /dev/null @@ -1,150 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Book.daisy_file' - db.add_column('catalogue_book', 'daisy_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Book.daisy_file' - db.delete_column('catalogue_book', 'daisy_file') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'daisy_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookstub': { - 'Meta': {'ordering': "('title',)", 'object_name': 'BookStub'}, - 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0003_auto__chg_field_book_created_at.py b/apps/catalogue/migrations/0003_auto__chg_field_book_created_at.py deleted file mode 100644 index dc53778ce..000000000 --- a/apps/catalogue/migrations/0003_auto__chg_field_book_created_at.py +++ /dev/null @@ -1,150 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Book.created_at' - db.alter_column('catalogue_book', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True)) - - - def backwards(self, orm): - - # Changing field 'Book.created_at' - db.alter_column('catalogue_book', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True)) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'daisy_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookstub': { - 'Meta': {'ordering': "('title',)", 'object_name': 'BookStub'}, - 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0004_auto__chg_field_tag_sort_key.py b/apps/catalogue/migrations/0004_auto__chg_field_tag_sort_key.py deleted file mode 100644 index 557158ac5..000000000 --- a/apps/catalogue/migrations/0004_auto__chg_field_tag_sort_key.py +++ /dev/null @@ -1,168 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Tag.sort_key' - db.alter_column('catalogue_tag', 'sort_key', self.gf('django.db.models.fields.CharField')(max_length=120)) - - if not db.dry_run: - for tag in orm.Tag.objects.exclude(category__in=('set', 'author')): - tag.sort_key = tag.name.lower() - tag.save() - for tag in orm.Tag.objects.filter(category='author'): - tag.sort_key = tag.name[-len(tag.sort_key):].lower() - tag.save() - - - - def backwards(self, orm): - # slugify all sort_keys - if not db.dry_run: - try: - from slughifi import slughifi as slugify - except ImportError: - from django.template.defaultfilters import slugify - for tag in orm.Tag.objects.all(): - tag.sort_key = slugify(tag.sort_key) - tag.save() - - # Changing field 'Tag.sort_key' - db.alter_column('catalogue_tag', 'sort_key', self.gf('django.db.models.fields.SlugField')(max_length=120)) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'daisy_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookstub': { - 'Meta': {'ordering': "('title',)", 'object_name': 'BookStub'}, - 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0005_many2many_files_for_books.py b/apps/catalogue/migrations/0005_many2many_files_for_books.py deleted file mode 100644 index 0af3cba0a..000000000 --- a/apps/catalogue/migrations/0005_many2many_files_for_books.py +++ /dev/null @@ -1,272 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models -from django.utils import simplejson as json -from mutagen import id3 - - -def get_mp3_info(file): - """Retrieves artist and director names from audio ID3 tags.""" - try: - audio = id3.ID3(file.path) - artist_name = ', '.join(', '.join(tag.text) for tag in audio.getall('TPE1')) - director_name = ', '.join(', '.join(tag.text) for tag in audio.getall('TPE3')) - except: - artist_name = director_name = '' - return {'artist_name': artist_name, 'director_name': director_name} - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'BookMedia' - db.create_table('catalogue_bookmedia', ( - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('type', self.gf('django.db.models.fields.CharField')(max_length='100')), - ('name', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)), - ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100, blank=True)), - ('uploaded_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('extra_info', self.gf('catalogue.fields.JSONField')(default='{}')), - )) - db.send_create_signal('catalogue', ['BookMedia']) - - # Adding M2M table for field medias on 'Book' - db.create_table('catalogue_book_medias', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('book', models.ForeignKey(orm['catalogue.book'], null=False)), - ('bookmedia', models.ForeignKey(orm['catalogue.bookmedia'], null=False)) - )) - db.create_unique('catalogue_book_medias', ['book_id', 'bookmedia_id']) - - # Data migration - if not db.dry_run: - jsonencoder = json.JSONEncoder() - for book in orm['old.book'].objects.all(): - medias = [] - if book.odt_file: - medias.append({"file": book.odt_file, "type": "odt"}) - if book.daisy_file: - medias.append({"file": book.daisy_file, "type": "daisy"}) - if book.ogg_file: - medias.append({"file": book.ogg_file, "type": "ogg"}) - if book.mp3_file: - medias.append({"file": book.mp3_file, "type": "mp3"}) - newbook = orm.Book.objects.get(pk=book.pk) - for media in medias: - name = book.title - bookMedia = orm.BookMedia.objects.create(file=media['file'], type=media['type'], name=name) - if bookMedia.type == 'mp3': - bookMedia.extra_info = jsonencoder.encode(get_mp3_info(bookMedia.file)) - bookMedia.save() - newbook.medias.add(bookMedia) - - # Deleting field 'Book.odt_file' - db.delete_column('catalogue_book', 'odt_file') - - # Deleting field 'Book.daisy_file' - db.delete_column('catalogue_book', 'daisy_file') - - # Deleting field 'Book.ogg_file' - db.delete_column('catalogue_book', 'ogg_file') - - # Deleting field 'Book.mp3_file' - db.delete_column('catalogue_book', 'mp3_file') - - # Changing field 'Tag.main_page' - db.alter_column('catalogue_tag', 'main_page', self.gf('django.db.models.fields.BooleanField')(blank=True)) - - - def backwards(self, orm): - # Deleting model 'BookMedia' - db.delete_table('catalogue_bookmedia') - - # Adding field 'Book.odt_file' - db.add_column('catalogue_book', 'odt_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) - - # Adding field 'Book.daisy_file' - db.add_column('catalogue_book', 'daisy_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) - - # Adding field 'Book.ogg_file' - db.add_column('catalogue_book', 'ogg_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) - - # Adding field 'Book.mp3_file' - db.add_column('catalogue_book', 'mp3_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) - - # Removing M2M table for field medias on 'Book' - db.delete_table('catalogue_book_medias') - - # Changing field 'Tag.main_page' - db.alter_column('catalogue_tag', 'main_page', self.gf('django.db.models.fields.BooleanField')()) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'medias': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.BookMedia']", 'symmetrical': 'False'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'object_name': 'BookMedia'}, - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.bookstub': { - 'Meta': {'object_name': 'BookStub'}, - 'author': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'pd': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'translator': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'translator_death': ('django.db.models.fields.TextField', [], {'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'death': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'old.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book', 'db_table': "'catalogue_book'"}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'daisy_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mp3_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'odt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'ogg_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0006_auto__del_bookstub__del_field_tag_death.py b/apps/catalogue/migrations/0006_auto__del_bookstub__del_field_tag_death.py deleted file mode 100644 index 5abf27e65..000000000 --- a/apps/catalogue/migrations/0006_auto__del_bookstub__del_field_tag_death.py +++ /dev/null @@ -1,160 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Deleting model 'BookStub' - db.delete_table('catalogue_bookstub') - - # Deleting field 'Tag.death' - db.delete_column('catalogue_tag', 'death') - - - def backwards(self, orm): - - # Adding model 'BookStub' - db.create_table('catalogue_bookstub', ( - ('title', self.gf('django.db.models.fields.CharField')(max_length=120)), - ('author', self.gf('django.db.models.fields.CharField')(max_length=120)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('translator', self.gf('django.db.models.fields.TextField')(blank=True)), - ('translator_death', self.gf('django.db.models.fields.TextField')(blank=True)), - ('pd', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)), - ('slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=120, db_index=True)), - )) - db.send_create_signal('catalogue', ['BookStub']) - - # Adding field 'Tag.death' - db.add_column('catalogue_tag', 'death', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True), keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'medias': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.BookMedia']", 'symmetrical': 'False', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'", 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0007_auto__add_field_bookmedia_book.py b/apps/catalogue/migrations/0007_auto__add_field_bookmedia_book.py deleted file mode 100644 index e48ef25dc..000000000 --- a/apps/catalogue/migrations/0007_auto__add_field_bookmedia_book.py +++ /dev/null @@ -1,146 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'BookMedia.book' - db.add_column('catalogue_bookmedia', 'book', self.gf('django.db.models.fields.related.ForeignKey')(related_name='media', null=True, to=orm['catalogue.Book']), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'BookMedia.book' - db.delete_column('catalogue_bookmedia', 'book_id') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'medias': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'book_set'", 'blank': 'True', 'to': "orm['catalogue.BookMedia']"}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0008_move_media.py b/apps/catalogue/migrations/0008_move_media.py deleted file mode 100644 index 7428dea54..000000000 --- a/apps/catalogue/migrations/0008_move_media.py +++ /dev/null @@ -1,148 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - for media in orm.BookMedia.objects.all(): - try: - media.book = media.book_set.all()[0] - media.save() - except IndexError, e: - media.delete() - - - def backwards(self, orm): - for media in orm.BookMedia.objects.all(): - media.book_set = [media.book] - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'medias': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'book_set'", 'blank': 'True', 'to': "orm['catalogue.BookMedia']"}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0009_auto.py b/apps/catalogue/migrations/0009_auto.py deleted file mode 100644 index 9c8e5c978..000000000 --- a/apps/catalogue/migrations/0009_auto.py +++ /dev/null @@ -1,156 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Removing M2M table for field medias on 'Book' - db.delete_table('catalogue_book_medias') - - # Changing field 'BookMedia.book' - db.alter_column('catalogue_bookmedia', 'book_id', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['catalogue.Book'])) - - - def backwards(self, orm): - - # Adding M2M table for field medias on 'Book' - db.create_table('catalogue_book_medias', ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('book', models.ForeignKey(orm['catalogue.book'], null=False)), - ('bookmedia', models.ForeignKey(orm['catalogue.bookmedia'], null=False)) - )) - db.create_unique('catalogue_book_medias', ['book_id', 'bookmedia_id']) - - # Changing field 'BookMedia.book' - db.alter_column('catalogue_bookmedia', 'book_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['catalogue.Book'])) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0010_auto__add_field_bookmedia_source_sha1.py b/apps/catalogue/migrations/0010_auto__add_field_bookmedia_source_sha1.py deleted file mode 100644 index e53de5539..000000000 --- a/apps/catalogue/migrations/0010_auto__add_field_bookmedia_source_sha1.py +++ /dev/null @@ -1,146 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'BookMedia.source_sha1' - db.add_column('catalogue_bookmedia', 'source_sha1', self.gf('django.db.models.fields.CharField')(max_length=40, null=True, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'BookMedia.source_sha1' - db.delete_column('catalogue_bookmedia', 'source_sha1') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0011_auto__add_field_book_changed_at__add_field_tag_created_at__add_field_t.py b/apps/catalogue/migrations/0011_auto__add_field_book_changed_at__add_field_tag_created_at__add_field_t.py deleted file mode 100644 index 2f573ba1b..000000000 --- a/apps/catalogue/migrations/0011_auto__add_field_book_changed_at__add_field_tag_created_at__add_field_t.py +++ /dev/null @@ -1,167 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Book.changed_at' - db.add_column('catalogue_book', 'changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2011, 2, 25, 15, 19, 36, 525463), db_index=True, blank=True), keep_default=False) - - # Adding index on 'Book', fields ['created_at'] - db.create_index('catalogue_book', ['created_at']) - - # Adding field 'Tag.created_at' - db.add_column('catalogue_tag', 'created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.datetime(2011, 2, 25, 15, 19, 42, 921525), db_index=True, blank=True), keep_default=False) - - # Adding field 'Tag.changed_at' - db.add_column('catalogue_tag', 'changed_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2011, 2, 25, 15, 19, 45, 697471), db_index=True, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Removing index on 'Book', fields ['created_at'] - db.delete_index('catalogue_book', ['created_at']) - - # Deleting field 'Book.changed_at' - db.delete_column('catalogue_book', 'changed_at') - - # Deleting field 'Tag.created_at' - db.delete_column('catalogue_tag', 'created_at') - - # Deleting field 'Tag.changed_at' - db.delete_column('catalogue_tag', 'changed_at') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'children'", 'blank': 'True', 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'unique': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0012_auto__add_field_book_sort_key.py b/apps/catalogue/migrations/0012_auto__add_field_book_sort_key.py deleted file mode 100644 index 466e8cc22..000000000 --- a/apps/catalogue/migrations/0012_auto__add_field_book_sort_key.py +++ /dev/null @@ -1,150 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Book.sort_key' - db.add_column('catalogue_book', 'sort_key', self.gf('django.db.models.fields.CharField')(default='', max_length=120, db_index=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Book.sort_key' - db.delete_column('catalogue_book', 'sort_key') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0013_sortify.py b/apps/catalogue/migrations/0013_sortify.py deleted file mode 100644 index bc1218952..000000000 --- a/apps/catalogue/migrations/0013_sortify.py +++ /dev/null @@ -1,158 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -from sortify import sortify - - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - - for b in orm.Book.objects.all(): - b.sort_key = sortify(b.title) - b.save() - - for t in orm.Tag.objects.all(): - t.sort_key = sortify(t.sort_key) - t.save() - - - def backwards(self, orm): - "Write your backwards methods here." - pass - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0014_auto__chg_field_bookmedia_file.py b/apps/catalogue/migrations/0014_auto__chg_field_bookmedia_file.py deleted file mode 100644 index 579a68191..000000000 --- a/apps/catalogue/migrations/0014_auto__chg_field_bookmedia_file.py +++ /dev/null @@ -1,150 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'BookMedia.file' - db.alter_column('catalogue_bookmedia', 'file', self.gf('catalogue.fields.OverwritingFileField')(max_length=100)) - - - def backwards(self, orm): - - # Changing field 'BookMedia.file' - db.alter_column('catalogue_bookmedia', 'file', self.gf('django.db.models.fields.files.FileField')(max_length=100)) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_tag_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - '_theme_counter': ('catalogue.fields.JSONField', [], {'null': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - '_short_html': ('django.db.models.fields.TextField', [], {}), - '_short_html_de': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_en': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_es': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_fr': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_lt': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_pl': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_ru': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - '_short_html_uk': ('django.db.models.fields.TextField', [], {'null': True, 'blank': True}), - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0015_auto__del_field_book__short_html_en__del_field_book__short_html_es__de.py b/apps/catalogue/migrations/0015_auto__del_field_book__short_html_en__del_field_book__short_html_es__de.py deleted file mode 100644 index 72acef980..000000000 --- a/apps/catalogue/migrations/0015_auto__del_field_book__short_html_en__del_field_book__short_html_es__de.py +++ /dev/null @@ -1,244 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Deleting field 'Book._short_html_en' - db.delete_column('catalogue_book', '_short_html_en') - - # Deleting field 'Book._short_html_es' - db.delete_column('catalogue_book', '_short_html_es') - - # Deleting field 'Book._theme_counter' - db.delete_column('catalogue_book', '_theme_counter') - - # Deleting field 'Book._short_html_de' - db.delete_column('catalogue_book', '_short_html_de') - - # Deleting field 'Book._short_html_fr' - db.delete_column('catalogue_book', '_short_html_fr') - - # Deleting field 'Book._short_html_uk' - db.delete_column('catalogue_book', '_short_html_uk') - - # Deleting field 'Book._short_html_pl' - db.delete_column('catalogue_book', '_short_html_pl') - - # Deleting field 'Book._short_html_lt' - db.delete_column('catalogue_book', '_short_html_lt') - - # Deleting field 'Book._short_html_ru' - db.delete_column('catalogue_book', '_short_html_ru') - - # Deleting field 'Book._short_html' - db.delete_column('catalogue_book', '_short_html') - - # Deleting field 'Book._tag_counter' - db.delete_column('catalogue_book', '_tag_counter') - - # Deleting field 'Fragment._short_html_de' - db.delete_column('catalogue_fragment', '_short_html_de') - - # Deleting field 'Fragment._short_html_en' - db.delete_column('catalogue_fragment', '_short_html_en') - - # Deleting field 'Fragment._short_html_fr' - db.delete_column('catalogue_fragment', '_short_html_fr') - - # Deleting field 'Fragment._short_html_es' - db.delete_column('catalogue_fragment', '_short_html_es') - - # Deleting field 'Fragment._short_html_uk' - db.delete_column('catalogue_fragment', '_short_html_uk') - - # Deleting field 'Fragment._short_html_pl' - db.delete_column('catalogue_fragment', '_short_html_pl') - - # Deleting field 'Fragment._short_html_lt' - db.delete_column('catalogue_fragment', '_short_html_lt') - - # Deleting field 'Fragment._short_html_ru' - db.delete_column('catalogue_fragment', '_short_html_ru') - - # Deleting field 'Fragment._short_html' - db.delete_column('catalogue_fragment', '_short_html') - - - def backwards(self, orm): - - # Adding field 'Book._short_html_en' - db.add_column('catalogue_book', '_short_html_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html_es' - db.add_column('catalogue_book', '_short_html_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._theme_counter' - db.add_column('catalogue_book', '_theme_counter', self.gf('catalogue.fields.JSONField')(null=True), keep_default=False) - - # Adding field 'Book._short_html_de' - db.add_column('catalogue_book', '_short_html_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html_fr' - db.add_column('catalogue_book', '_short_html_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html_uk' - db.add_column('catalogue_book', '_short_html_uk', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html_pl' - db.add_column('catalogue_book', '_short_html_pl', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html_lt' - db.add_column('catalogue_book', '_short_html_lt', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html_ru' - db.add_column('catalogue_book', '_short_html_ru', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Book._short_html' - db.add_column('catalogue_book', '_short_html', self.gf('django.db.models.fields.TextField')(default=''), keep_default=False) - - # Adding field 'Book._tag_counter' - db.add_column('catalogue_book', '_tag_counter', self.gf('catalogue.fields.JSONField')(null=True), keep_default=False) - - # Adding field 'Fragment._short_html_de' - db.add_column('catalogue_fragment', '_short_html_de', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_en' - db.add_column('catalogue_fragment', '_short_html_en', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_fr' - db.add_column('catalogue_fragment', '_short_html_fr', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_es' - db.add_column('catalogue_fragment', '_short_html_es', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_uk' - db.add_column('catalogue_fragment', '_short_html_uk', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_pl' - db.add_column('catalogue_fragment', '_short_html_pl', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_lt' - db.add_column('catalogue_fragment', '_short_html_lt', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html_ru' - db.add_column('catalogue_fragment', '_short_html_ru', self.gf('django.db.models.fields.TextField')(null=True, blank=True), keep_default=False) - - # Adding field 'Fragment._short_html' - db.add_column('catalogue_fragment', '_short_html', self.gf('django.db.models.fields.TextField')(default=''), keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0016_auto__add_field_book_mobi_file.py b/apps/catalogue/migrations/0016_auto__add_field_book_mobi_file.py deleted file mode 100644 index 87faf6bc2..000000000 --- a/apps/catalogue/migrations/0016_auto__add_field_book_mobi_file.py +++ /dev/null @@ -1,131 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Book.mobi_file' - db.add_column('catalogue_book', 'mobi_file', self.gf('django.db.models.fields.files.FileField')(default='', max_length=100, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Book.mobi_file' - db.delete_column('catalogue_book', 'mobi_file') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0017_auto__add_field_book_language__del_unique_book_slug__add_unique_book_s.py b/apps/catalogue/migrations/0017_auto__add_field_book_language__del_unique_book_slug__add_unique_book_s.py deleted file mode 100644 index 6d1edcfa1..000000000 --- a/apps/catalogue/migrations/0017_auto__add_field_book_language__del_unique_book_slug__add_unique_book_s.py +++ /dev/null @@ -1,144 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Removing unique constraint on 'Book', fields ['slug'] - db.delete_unique('catalogue_book', ['slug']) - - # Adding field 'Book.language' - db.add_column('catalogue_book', 'language', self.gf('django.db.models.fields.CharField')(default='pol', max_length=3, db_index=True), keep_default=False) - - # Adding unique constraint on 'Book', fields ['slug', 'language'] - db.create_unique('catalogue_book', ['slug', 'language']) - - - def backwards(self, orm): - - # Removing unique constraint on 'Book', fields ['slug', 'language'] - db.delete_unique('catalogue_book', ['slug', 'language']) - - # Deleting field 'Book.language' - db.delete_column('catalogue_book', 'language') - - # Adding unique constraint on 'Book', fields ['slug'] - db.create_unique('catalogue_book', ['slug']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "[['slug', 'language']]", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.filerecord': { - 'Meta': {'ordering': "('-time', '-slug', '-type')", 'object_name': 'FileRecord'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'sha1': ('django.db.models.fields.CharField', [], {'max_length': '40'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'time': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': '20', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0018_auto__del_filerecord.py b/apps/catalogue/migrations/0018_auto__del_filerecord.py deleted file mode 100644 index 66a6542a3..000000000 --- a/apps/catalogue/migrations/0018_auto__del_filerecord.py +++ /dev/null @@ -1,131 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Deleting model 'FileRecord' - db.delete_table('catalogue_filerecord') - - - def backwards(self, orm): - - # Adding model 'FileRecord' - db.create_table('catalogue_filerecord', ( - ('sha1', self.gf('django.db.models.fields.CharField')(max_length=40)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('time', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('type', self.gf('django.db.models.fields.CharField')(max_length=20, db_index=True)), - ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), - )) - db.send_create_signal('catalogue', ['FileRecord']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "[['slug', 'language']]", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0019_auto__add_field_book_cover.py b/apps/catalogue/migrations/0019_auto__add_field_book_cover.py deleted file mode 100644 index 259d935ba..000000000 --- a/apps/catalogue/migrations/0019_auto__add_field_book_cover.py +++ /dev/null @@ -1,125 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Book.cover' - db.add_column('catalogue_book', 'cover', self.gf('django.db.models.fields.files.FileField')(max_length=100, null=True, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Book.cover' - db.delete_column('catalogue_book', 'cover') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "[['slug', 'language']]", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_page': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0020_auto__del_field_tag_main_page.py b/apps/catalogue/migrations/0020_auto__del_field_tag_main_page.py deleted file mode 100644 index e9f77946e..000000000 --- a/apps/catalogue/migrations/0020_auto__del_field_tag_main_page.py +++ /dev/null @@ -1,124 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Deleting field 'Tag.main_page' - db.delete_column('catalogue_tag', 'main_page') - - - def backwards(self, orm): - - # Adding field 'Tag.main_page' - db.add_column('catalogue_tag', 'main_page', self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True), keep_default=False) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "[['slug', 'language']]", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0021_build_covers.py b/apps/catalogue/migrations/0021_build_covers.py deleted file mode 100644 index 319decb18..000000000 --- a/apps/catalogue/migrations/0021_build_covers.py +++ /dev/null @@ -1,137 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - from StringIO import StringIO - from django.core.files.base import ContentFile - from librarian import ValidationError - from librarian.cover import WLCover - from librarian.dcparser import BookInfo - - for book in orm.Book.objects.filter(cover=None): - try: - book_info = BookInfo.from_file(book.xml_file.path) - except ValidationError: - pass - else: - cover = WLCover(book_info).image() - imgstr = StringIO() - cover.save(imgstr, 'png') - book.cover.save('book/png/%s.png' % book.slug, - ContentFile(imgstr.getvalue())) - - - def backwards(self, orm): - "Write your backwards methods here." - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "[['slug', 'language']]", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0022_auto__add_field_book_common_slug__add_unique_book_slug__del_unique_boo.py b/apps/catalogue/migrations/0022_auto__add_field_book_common_slug__add_unique_book_slug__del_unique_boo.py deleted file mode 100644 index 75a1c99f4..000000000 --- a/apps/catalogue/migrations/0022_auto__add_field_book_common_slug__add_unique_book_slug__del_unique_boo.py +++ /dev/null @@ -1,137 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Removing unique constraint on 'Book', fields ['slug', 'language'] - db.delete_unique('catalogue_book', ['slug', 'language']) - - # Adding field 'Book.common_slug' - db.add_column('catalogue_book', 'common_slug', self.gf('django.db.models.fields.SlugField')(default='-', max_length=120, db_index=True), keep_default=False) - - # Adding unique constraint on 'Book', fields ['slug'] - db.create_unique('catalogue_book', ['slug']) - - - def backwards(self, orm): - - # Removing unique constraint on 'Book', fields ['slug'] - db.delete_unique('catalogue_book', ['slug']) - - # Deleting field 'Book.common_slug' - db.delete_column('catalogue_book', 'common_slug') - - # Adding unique constraint on 'Book', fields ['slug', 'language'] - db.create_unique('catalogue_book', ['slug', 'language']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0023_common_slug.py b/apps/catalogue/migrations/0023_common_slug.py deleted file mode 100644 index 386314915..000000000 --- a/apps/catalogue/migrations/0023_common_slug.py +++ /dev/null @@ -1,123 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - orm.Book.objects.all().update(common_slug=models.F('slug')) - - - def backwards(self, orm): - "Write your backwards methods here." - pass - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0024_auto__add_collection.py b/apps/catalogue/migrations/0024_auto__add_collection.py deleted file mode 100644 index e2e21007d..000000000 --- a/apps/catalogue/migrations/0024_auto__add_collection.py +++ /dev/null @@ -1,138 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding model 'Collection' - db.create_table('catalogue_collection', ( - ('title', self.gf('django.db.models.fields.CharField')(max_length=120, db_index=True)), - ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, primary_key=True, db_index=True)), - ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)), - ('book_slugs', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal('catalogue', ['Collection']) - - - def backwards(self, orm): - - # Deleting model 'Collection' - db.delete_table('catalogue_collection') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.collection': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'}, - 'book_slugs': ('django.db.models.fields.TextField', [], {}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0025_auto__add_field_book__related_info.py b/apps/catalogue/migrations/0025_auto__add_field_book__related_info.py deleted file mode 100644 index a46e34d0e..000000000 --- a/apps/catalogue/migrations/0025_auto__add_field_book__related_info.py +++ /dev/null @@ -1,133 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Book._related_info' - db.add_column('catalogue_book', '_related_info', self.gf('jsonfield.fields.JSONField')(null=True, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Book._related_info' - db.delete_column('catalogue_book', '_related_info') - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.collection': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'}, - 'book_slugs': ('django.db.models.fields.TextField', [], {}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/migrations/0026_set_names.py b/apps/catalogue/migrations/0026_set_names.py deleted file mode 100644 index 837e4d034..000000000 --- a/apps/catalogue/migrations/0026_set_names.py +++ /dev/null @@ -1,132 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - for tag in orm.Tag.objects.filter(category='set', name__contains=','): - tag.name = tag.name.replace(', ', ' ').replace(',', ' ') - tag.save() - - - def backwards(self, orm): - "Write your backwards methods here." - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'catalogue.bookmedia': { - 'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), - 'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'catalogue.collection': { - 'Meta': {'ordering': "('title',)", 'object_name': 'Collection'}, - 'book_slugs': ('django.db.models.fields.TextField', [], {}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}) - }, - 'catalogue.fragment': { - 'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'}, - 'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'short_text': ('django.db.models.fields.TextField', [], {}), - 'text': ('django.db.models.fields.TextField', [], {}) - }, - 'catalogue.tag': { - 'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'}, - 'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}) - }, - 'catalogue.tagrelation': { - 'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - } - } - - complete_apps = ['catalogue'] diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index ba1a5d203..72cbeda39 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -22,7 +22,7 @@ from django.conf import settings from newtagging.models import TagBase, tags_updated from newtagging import managers -from catalogue.fields import JSONField, OverwritingFileField +from catalogue.fields import OverwritingFileField from catalogue.utils import create_zip, split_tags, truncate_html_words from catalogue import tasks import re @@ -115,8 +115,8 @@ class Tag(TagBase): objects = Book.tagged.with_all((self,)).order_by() if self.category != 'set': # eliminate descendants - l_tags = Tag.objects.filter(slug__in=[book.book_tag_slug() for book in objects]) - descendants_keys = [book.pk for book in Book.tagged.with_any(l_tags)] + l_tags = Tag.objects.filter(slug__in=[book.book_tag_slug() for book in objects.iterator()]) + descendants_keys = [book.pk for book in Book.tagged.with_any(l_tags).iterator()] if descendants_keys: objects = objects.exclude(pk__in=descendants_keys) return objects.count() @@ -226,7 +226,7 @@ class BookMedia(models.Model): name = models.CharField(_('name'), max_length="100") file = OverwritingFileField(_('file'), upload_to=book_upload_path()) uploaded_at = models.DateTimeField(_('creation date'), auto_now_add=True, editable=False) - extra_info = JSONField(_('extra information'), default='{}', editable=False) + extra_info = jsonfield.JSONField(_('extra information'), default='{}', editable=False) book = models.ForeignKey('Book', related_name='media') source_sha1 = models.CharField(null=True, blank=True, max_length=40, editable=False) @@ -258,9 +258,9 @@ class BookMedia(models.Model): remove_zip("%s_%s" % (old.book.slug, old.type)) remove_zip("%s_%s" % (self.book.slug, self.type)) - extra_info = self.get_extra_info_value() + extra_info = self.extra_info extra_info.update(self.read_meta()) - self.set_extra_info_value(extra_info) + self.extra_info = extra_info self.source_sha1 = self.read_source_sha1(self.file.path, self.type) return super(BookMedia, self).save(*args, **kwargs) @@ -334,7 +334,7 @@ class Book(models.Model): created_at = models.DateTimeField(_('creation date'), auto_now_add=True, db_index=True) changed_at = models.DateTimeField(_('creation date'), auto_now=True, db_index=True) parent_number = models.IntegerField(_('parent number'), default=0) - extra_info = JSONField(_('extra information'), default='{}') + extra_info = jsonfield.JSONField(_('extra information'), default='{}') gazeta_link = models.CharField(blank=True, max_length=240) wiki_link = models.CharField(blank=True, max_length=240) # files generated during publication @@ -428,7 +428,7 @@ class Book(models.Model): type(self).objects.filter(pk=self.pk).update(_related_info=None) # Fragment.short_html relies on book's tags, so reset it here too - for fragm in self.fragments.all(): + for fragm in self.fragments.all().iterator(): fragm.reset_short_html() def has_description(self): @@ -545,14 +545,14 @@ class Book(models.Model): def zip_format(format_): def pretty_file_name(book): return "%s/%s.%s" % ( - b.get_extra_info_value()['author'], + b.extra_info['author'], b.slug, format_) field_name = "%s_file" % format_ books = Book.objects.filter(parent=None).exclude(**{field_name: ""}) paths = [(pretty_file_name(b), getattr(b, field_name).path) - for b in books] + for b in books.iterator()] return create_zip(paths, getattr(settings, "ALL_%s_ZIP" % format_.upper())) @@ -628,7 +628,7 @@ class Book(models.Model): book.common_slug = book_info.variant_of.slug else: book.common_slug = book.slug - book.set_extra_info_value(book_info.to_dict()) + book.extra_info = book_info.to_dict() book.save() meta_tags = Tag.tags_from_info(book_info) @@ -675,7 +675,7 @@ class Book(models.Model): descendants_tags.update(child_book.tags) child_book.tags = list(child_book.tags) + [book_tag] child_book.save() - for fragment in child_book.fragments.all(): + for fragment in child_book.fragments.all().iterator(): fragment.tags = set(list(fragment.tags) + [book_tag]) book_descendants += list(child_book.children.all()) @@ -723,7 +723,7 @@ class Book(models.Model): def related_themes(self): theme_counter = self.theme_counter - book_themes = Tag.objects.filter(pk__in=theme_counter.keys()) + book_themes = list(Tag.objects.filter(pk__in=theme_counter.keys())) for tag in book_themes: tag.count = theme_counter[tag.pk] return book_themes @@ -747,10 +747,10 @@ class Book(models.Model): if tags is None: tags = {} - for child in self.children.all().order_by(): + for child in self.children.all().order_by().iterator(): for tag_pk, value in child.tag_counter.iteritems(): tags[tag_pk] = tags.get(tag_pk, 0) + value - for tag in self.tags.exclude(category__in=('book', 'theme', 'set')).order_by(): + for tag in self.tags.exclude(category__in=('book', 'theme', 'set')).order_by().iterator(): tags[tag.pk] = 1 if self.id: @@ -776,8 +776,8 @@ class Book(models.Model): if tags is None: tags = {} - for fragment in Fragment.tagged.with_any([self.book_tag()]).order_by(): - for tag in fragment.tags.filter(category='theme').order_by(): + for fragment in Fragment.tagged.with_any([self.book_tag()]).order_by().iterator(): + for tag in fragment.tags.filter(category='theme').order_by().iterator(): tags[tag.pk] = tags.get(tag.pk, 0) + 1 if self.id: @@ -812,8 +812,9 @@ class Book(models.Model): # get relevant books and their tags objects = cls.tagged.with_all(tags) # eliminate descendants - l_tags = Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in objects]) - descendants_keys = [book.pk for book in cls.tagged.with_any(l_tags)] + l_tags = Tag.objects.filter(category='book', + slug__in=[book.book_tag_slug() for book in objects.iterator()]) + descendants_keys = [book.pk for book in cls.tagged.with_any(l_tags).iterator()] if descendants_keys: objects = objects.exclude(pk__in=descendants_keys) @@ -832,19 +833,20 @@ class Book(models.Model): 'title', 'parent', 'slug') if filter: books = books.filter(filter).distinct() - book_ids = set((book.pk for book in books)) - for book in books: + + book_ids = set(b['pk'] for b in books.values("pk").iterator()) + for book in books.iterator(): parent = book.parent_id if parent not in book_ids: parent = None books_by_parent.setdefault(parent, []).append(book) else: - for book in books: + for book in books.iterator(): books_by_parent.setdefault(book.parent_id, []).append(book) orphans = [] books_by_author = SortedDict() - for tag in Tag.objects.filter(category='author'): + for tag in Tag.objects.filter(category='author').iterator(): books_by_author[tag] = [] for book in books_by_parent.get(None,()): @@ -866,7 +868,7 @@ class Book(models.Model): "LP": (3, u"liceum"), } def audiences_pl(self): - audiences = self.get_extra_info_value().get('audiences', []) + audiences = self.extra_info.get('audiences', []) audiences = sorted(set([self._audiences_pl[a] for a in audiences])) return [a[1] for a in audiences] diff --git a/apps/catalogue/templates/catalogue/book_info.html b/apps/catalogue/templates/catalogue/book_info.html index 670679e28..e9f351258 100755 --- a/apps/catalogue/templates/catalogue/book_info.html +++ b/apps/catalogue/templates/catalogue/book_info.html @@ -2,9 +2,9 @@ {% load catalogue_tags %}

- {% if book.get_extra_info_value.license %} + {% if book.extra_info.license %} {% trans "This work is licensed under:" %} - {{ book.get_extra_info_value.license_description }} + {{ book.extra_info.license_description }} {% else %} {% blocktrans %}This work isn't covered by copyright and is part of the public domain, which means it can be freely used, published and @@ -16,15 +16,15 @@ {% endif %}

-{% if book.get_extra_info_value.source_name %} -

{% trans "Text prepared based on:" %} {{ book.get_extra_info_value.source_name }}

+{% if book.extra_info.source_name %} +

{% trans "Text prepared based on:" %} {{ book.extra_info.source_name }}

{% endif %} -{% if book.get_extra_info_value.description %} -

{{ book.get_extra_info_value.description }}

+{% if book.extra_info.description %} +

{{ book.extra_info.description }}

{% endif %} -{% if book.get_extra_info_value.editor or book.get_extra_info_value.technical_editor %} +{% if book.extra_info.editor or book.extra_info.technical_editor %}

{% trans "Edited and annotated by:" %} - {% all_editors book.get_extra_info_value %}.

+ {% all_editors book.extra_info %}.

{% endif %} diff --git a/apps/catalogue/templates/catalogue/player.html b/apps/catalogue/templates/catalogue/player.html index aeae44f21..a3ef25ca5 100755 --- a/apps/catalogue/templates/catalogue/player.html +++ b/apps/catalogue/templates/catalogue/player.html @@ -87,8 +87,8 @@
{{ i.mp3.name }}
- {% trans "Artist" %}: {{ i.mp3.get_extra_info_value.artist_name }}, - {% trans "Director" %}: {{ i.mp3.get_extra_info_value.director_name }} + {% trans "Artist" %}: {{ i.mp3.extra_info.artist_name }}, + {% trans "Director" %}: {{ i.mp3.extra_info.director_name }}
diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index e5e4d4fa0..78ce04ab5 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -206,7 +206,6 @@ def authentication_form(): @register.tag def catalogue_url(parser, token): bits = token.split_contents() - tag_name = bits[0] tags_to_add = [] tags_to_remove = [] @@ -296,14 +295,14 @@ def book_info(book): @register.inclusion_tag('catalogue/book_wide.html', takes_context=True) def book_wide(context, book): book_themes = book.related_themes() - extra_info = book.get_extra_info_value() + extra_info = book.extra_info hide_about = extra_info.get('about', '').startswith('http://wiki.wolnepodreczniki.pl') return { 'book': book, 'main_link': reverse('book_text', args=[book.slug]) if book.html_file else None, 'related': book.related_info(), - 'extra_info': book.get_extra_info_value(), + 'extra_info': extra_info, 'hide_about': hide_about, 'themes': book_themes, 'request': context.get('request'), diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index d2176bf6b..9687db6fd 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -132,13 +132,14 @@ def tagged_object_list(request, tags=''): if shelf_tags: books = models.Book.tagged.with_all(shelf_tags).order_by() - l_tags = models.Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in books]) + l_tags = models.Tag.objects.filter(category='book', + slug__in=[book.book_tag_slug() for book in books.iterator()]) fragments = models.Fragment.tagged.with_any(l_tags, fragments) # newtagging goes crazy if we just try: #related_tags = models.Tag.objects.usage_for_queryset(fragments, counts=True, # extra={'where': ["catalogue_tag.category != 'book'"]}) - fragment_keys = [fragment.pk for fragment in fragments] + fragment_keys = [fragment.pk for fragment in fragments.iterator()] if fragment_keys: related_tags = models.Fragment.tags.usage(counts=True, filters={'pk__in': fragment_keys}, @@ -156,7 +157,7 @@ def tagged_object_list(request, tags=''): # get related tags from `tag_counter` and `theme_counter` related_counts = {} tags_pks = [tag.pk for tag in tags] - for book in objects: + for book in objects.iterator(): for tag_pk, value in itertools.chain(book.tag_counter.iteritems(), book.theme_counter.iteritems()): if tag_pk in tags_pks: continue @@ -219,15 +220,15 @@ def player(request, slug): raise Http404 ogg_files = {} - for m in book.media.filter(type='ogg').order_by(): + for m in book.media.filter(type='ogg').order_by().iterator(): ogg_files[m.name] = m audiobooks = [] have_oggs = True projects = set() - for mp3 in book.media.filter(type='mp3'): + for mp3 in book.media.filter(type='mp3').iterator(): # ogg files are always from the same project - meta = mp3.get_extra_info_value() + meta = mp3.extra_info project = meta.get('project') if not project: # temporary fallback @@ -246,7 +247,7 @@ def player(request, slug): projects = sorted(projects) - extra_info = book.get_extra_info_value() + extra_info = book.extra_info return render_to_response('catalogue/player.html', locals(), context_instance=RequestContext(request)) @@ -258,8 +259,8 @@ def book_text(request, slug): if not book.has_html_file(): raise Http404 book_themes = {} - for fragment in book.fragments.all(): - for theme in fragment.tags.filter(category='theme'): + for fragment in book.fragments.all().iterator(): + for theme in fragment.tags.filter(category='theme').iterator(): book_themes.setdefault(theme, []).append(fragment) book_themes = book_themes.items() diff --git a/apps/dictionary/migrations/0001_initial.py b/apps/dictionary/migrations/0001_initial.py index cf0c311fa..466df3be6 100644 --- a/apps/dictionary/migrations/0001_initial.py +++ b/apps/dictionary/migrations/0001_initial.py @@ -28,14 +28,19 @@ class Migration(SchemaMigration): models = { 'catalogue.book': { 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, + '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), + 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), + 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}), 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), + 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), diff --git a/apps/lesmianator/migrations/0001_initial.py b/apps/lesmianator/migrations/0001_initial.py index 9efb41f5a..358252b03 100644 --- a/apps/lesmianator/migrations/0001_initial.py +++ b/apps/lesmianator/migrations/0001_initial.py @@ -5,41 +5,47 @@ from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): - + def forwards(self, orm): # Adding model 'Poem' db.create_table('lesmianator_poem', ( - ('view_count', self.gf('django.db.models.fields.IntegerField')(default=1)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), ('text', self.gf('django.db.models.fields.TextField')()), + ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)), + ('created_from', self.gf('jsonfield.fields.JSONField')(null=True, blank=True)), ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('created_by', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), - ('slug', self.gf('django.db.models.fields.SlugField')(max_length=120, db_index=True)), - ('created_from', self.gf('catalogue.fields.JSONField')(null=True, blank=True)), ('seen_at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('view_count', self.gf('django.db.models.fields.IntegerField')(default=1)), )) db.send_create_signal('lesmianator', ['Poem']) # Adding model 'Continuations' db.create_table('lesmianator_continuations', ( - ('pickle', self.gf('django.db.models.fields.files.FileField')(max_length=100)), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('pickle', self.gf('django.db.models.fields.files.FileField')(max_length=100)), ('content_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['contenttypes.ContentType'])), ('object_id', self.gf('django.db.models.fields.PositiveIntegerField')()), )) db.send_create_signal('lesmianator', ['Continuations']) - - + + # Adding unique constraint on 'Continuations', fields ['content_type', 'object_id'] + db.create_unique('lesmianator_continuations', ['content_type_id', 'object_id']) + + def backwards(self, orm): + # Removing unique constraint on 'Continuations', fields ['content_type', 'object_id'] + db.delete_unique('lesmianator_continuations', ['content_type_id', 'object_id']) + # Deleting model 'Poem' db.delete_table('lesmianator_poem') # Deleting model 'Continuations' db.delete_table('lesmianator_continuations') - - + + models = { 'auth.group': { 'Meta': {'object_name': 'Group'}, @@ -48,7 +54,7 @@ class Migration(SchemaMigration): 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) }, 'auth.permission': { - 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), @@ -61,9 +67,9 @@ class Migration(SchemaMigration): 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), @@ -71,14 +77,14 @@ class Migration(SchemaMigration): 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) }, 'contenttypes.contenttype': { - 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, 'lesmianator.continuations': { - 'Meta': {'object_name': 'Continuations'}, + 'Meta': {'unique_together': "(('content_type', 'object_id'),)", 'object_name': 'Continuations'}, 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), @@ -87,8 +93,8 @@ class Migration(SchemaMigration): 'lesmianator.poem': { 'Meta': {'object_name': 'Poem'}, 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}), - 'created_from': ('catalogue.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), + 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), + 'created_from': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'seen_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), @@ -96,5 +102,5 @@ class Migration(SchemaMigration): 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '1'}) } } - + complete_apps = ['lesmianator'] diff --git a/apps/lesmianator/migrations/0002_auto__chg_field_poem_created_by.py b/apps/lesmianator/migrations/0002_auto__chg_field_poem_created_by.py deleted file mode 100644 index 65241e560..000000000 --- a/apps/lesmianator/migrations/0002_auto__chg_field_poem_created_by.py +++ /dev/null @@ -1,78 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Poem.created_by' - db.alter_column('lesmianator_poem', 'created_by_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) - - - def backwards(self, orm): - - # User chose to not deal with backwards NULL issues for 'Poem.created_by' - raise RuntimeError("Cannot reverse this migration. 'Poem.created_by' and its values cannot be restored.") - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'lesmianator.continuations': { - 'Meta': {'object_name': 'Continuations'}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'pickle': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) - }, - 'lesmianator.poem': { - 'Meta': {'object_name': 'Poem'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'created_from': ('catalogue.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'seen_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '1'}) - } - } - - complete_apps = ['lesmianator'] diff --git a/apps/lesmianator/migrations/0003_auto__add_unique_continuations_object_id_content_type.py b/apps/lesmianator/migrations/0003_auto__add_unique_continuations_object_id_content_type.py deleted file mode 100644 index 102d2f930..000000000 --- a/apps/lesmianator/migrations/0003_auto__add_unique_continuations_object_id_content_type.py +++ /dev/null @@ -1,78 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding unique constraint on 'Continuations', fields ['object_id', 'content_type'] - db.create_unique('lesmianator_continuations', ['object_id', 'content_type_id']) - - - def backwards(self, orm): - - # Removing unique constraint on 'Continuations', fields ['object_id', 'content_type'] - db.delete_unique('lesmianator_continuations', ['object_id', 'content_type_id']) - - - models = { - 'auth.group': { - 'Meta': {'object_name': 'Group'}, - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '80', 'unique': 'True'}), - 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - 'auth.permission': { - 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - 'auth.user': { - 'Meta': {'object_name': 'User'}, - 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), - 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), - 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), - 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), - 'username': ('django.db.models.fields.CharField', [], {'max_length': '30', 'unique': 'True'}) - }, - 'contenttypes.contenttype': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, - 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) - }, - 'lesmianator.continuations': { - 'Meta': {'unique_together': "(('content_type', 'object_id'),)", 'object_name': 'Continuations'}, - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}), - 'pickle': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}) - }, - 'lesmianator.poem': { - 'Meta': {'object_name': 'Poem'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'}), - 'created_from': ('catalogue.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'seen_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'view_count': ('django.db.models.fields.IntegerField', [], {'default': '1'}) - } - } - - complete_apps = ['lesmianator'] diff --git a/apps/lesmianator/models.py b/apps/lesmianator/models.py index 1b53efdcd..7fceda2fe 100644 --- a/apps/lesmianator/models.py +++ b/apps/lesmianator/models.py @@ -18,7 +18,7 @@ from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.conf import settings -from catalogue.fields import JSONField +from jsonfield import JSONField from catalogue.models import Book, Tag @@ -138,19 +138,19 @@ class Continuations(models.Model): last_word = last_word[-length+1:] + letter # add children return reduce(cls.join_conts, - (cls.get(child) for child in book.children.all()), + (cls.get(child) for child in book.children.all().iterator()), conts) @classmethod def for_set(cls, tag): # book contains its descendants, we don't want them twice books = Book.tagged.with_any((tag,)) - l_tags = Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in books]) - descendants_keys = [book.pk for book in Book.tagged.with_any(l_tags)] + l_tags = Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in books.iterator()]) + descendants_keys = [book.pk for book in Book.tagged.with_any(l_tags).iterator()] if descendants_keys: books = books.exclude(pk__in=descendants_keys) - cont_tabs = (cls.get(b) for b in books) + cont_tabs = (cls.get(b) for b in books.iterator()) return reduce(cls.join_conts, cont_tabs) @classmethod @@ -158,7 +158,7 @@ class Continuations(models.Model): object_type = ContentType.objects.get_for_model(sth) should_keys = set([sth.id]) if isinstance(sth, Tag): - should_keys = set(b.pk for b in Book.tagged.with_any((sth,))) + should_keys = set(b.pk for b in Book.tagged.with_any((sth,)).iterator()) try: obj = cls.objects.get(content_type=object_type, object_id=sth.id) if not obj.pickle: diff --git a/apps/lesmianator/views.py b/apps/lesmianator/views.py index e86febe91..7b289b7b6 100644 --- a/apps/lesmianator/views.py +++ b/apps/lesmianator/views.py @@ -38,7 +38,7 @@ def poem_from_book(request, slug): user = request.user if request.user.is_authenticated() else None text = Poem.write(Continuations.get(book)) p = Poem(slug=get_random_hash(text), text=text, created_by=user) - p.set_created_from_value([book.id]) + p.created_from = [book.id] p.save() return render_to_response('lesmianator/poem.html', @@ -53,7 +53,7 @@ def poem_from_set(request, shelf): text = Poem.write(Continuations.get(tag)) p = Poem(slug=get_random_hash(text), text=text, created_by=user) books = Book.tagged.with_any((tag,)) - p.set_created_from_value([b.id for b in books]) + p.created_from = [b.id for b in books] p.save() book = books[0] if len(books) == 1 else None @@ -66,7 +66,7 @@ def get_poem(request, poem): p = get_object_or_404(Poem, slug=poem) p.visit() if p.created_from: - books = Book.objects.filter(id__in=p.get_created_from_value()) + books = Book.objects.filter(id__in=p.created_from) book = books[0] if len(books) == 1 else None else: books = book = None diff --git a/apps/opds/views.py b/apps/opds/views.py index e01c17283..5a9e44a41 100644 --- a/apps/opds/views.py +++ b/apps/opds/views.py @@ -259,7 +259,7 @@ class ByTagFeed(AcquisitionFeed): def items(self, tag): books = Book.tagged.with_any([tag]) - l_tags = Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in books]) + l_tags = Tag.objects.filter(category='book', slug__in=[book.book_tag_slug() for book in books.iterator()]) descendants_keys = [book.pk for book in Book.tagged.with_any(l_tags)] if descendants_keys: books = books.exclude(pk__in=descendants_keys) diff --git a/apps/pdcounter/templatetags/__init__.py b/apps/pdcounter/templatetags/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/apps/pdcounter/templatetags/switch_tag.py b/apps/pdcounter/templatetags/switch_tag.py deleted file mode 100644 index 72476bef0..000000000 --- a/apps/pdcounter/templatetags/switch_tag.py +++ /dev/null @@ -1,135 +0,0 @@ -# Source: http://djangosnippets.org/snippets/967/ -# Author: adurdin -# Posted: August 13, 2008 -# -# -# We can use it based on djangosnippets Terms of Service: -# (http://djangosnippets.org/about/tos/) -# -# 2. That you grant any third party who sees the code you post -# a royalty-free, non-exclusive license to copy and distribute that code -# and to make and distribute derivative works based on that code. You may -# include license terms in snippets you post, if you wish to use -# a particular license (such as the BSD license or GNU GPL), but that -# license must permit royalty-free copying, distribution and modification -# of the code to which it is applied. - -from django import template -from django.template import Library, Node, VariableDoesNotExist - -register = Library() - - -@register.tag(name="switch") -def do_switch(parser, token): - """ - The ``{% switch %}`` tag compares a variable against one or more values in - ``{% case %}`` tags, and outputs the contents of the matching block. An - optional ``{% else %}`` tag sets off the default output if no matches - could be found:: - - {% switch result_count %} - {% case 0 %} - There are no search results. - {% case 1 %} - There is one search result. - {% else %} - Jackpot! Your search found {{ result_count }} results. - {% endswitch %} - - Each ``{% case %}`` tag can take multiple values to compare the variable - against:: - - {% switch username %} - {% case "Jim" "Bob" "Joe" %} - Me old mate {{ username }}! How ya doin? - {% else %} - Hello {{ username }} - {% endswitch %} - """ - bits = token.contents.split() - tag_name = bits[0] - if len(bits) != 2: - raise template.TemplateSyntaxError("'%s' tag requires one argument" % tag_name) - variable = parser.compile_filter(bits[1]) - - class BlockTagList(object): - # This is a bit of a hack, as it embeds knowledge of the behaviour - # of Parser.parse() relating to the "parse_until" argument. - def __init__(self, *names): - self.names = set(names) - def __contains__(self, token_contents): - name = token_contents.split()[0] - return name in self.names - - # Skip over everything before the first {% case %} tag - parser.parse(BlockTagList('case', 'endswitch')) - - cases = [] - token = parser.next_token() - got_case = False - got_else = False - while token.contents != 'endswitch': - nodelist = parser.parse(BlockTagList('case', 'else', 'endswitch')) - - if got_else: - raise template.TemplateSyntaxError("'else' must be last tag in '%s'." % tag_name) - - contents = token.contents.split() - token_name, token_args = contents[0], contents[1:] - - if token_name == 'case': - tests = map(parser.compile_filter, token_args) - case = (tests, nodelist) - got_case = True - else: - # The {% else %} tag - case = (None, nodelist) - got_else = True - cases.append(case) - token = parser.next_token() - - if not got_case: - raise template.TemplateSyntaxError("'%s' must have at least one 'case'." % tag_name) - - return SwitchNode(variable, cases) - -class SwitchNode(Node): - def __init__(self, variable, cases): - self.variable = variable - self.cases = cases - - def __repr__(self): - return "" - - def __iter__(self): - for tests, nodelist in self.cases: - for node in nodelist: - yield node - - def get_nodes_by_type(self, nodetype): - nodes = [] - if isinstance(self, nodetype): - nodes.append(self) - for tests, nodelist in self.cases: - nodes.extend(nodelist.get_nodes_by_type(nodetype)) - return nodes - - def render(self, context): - try: - value_missing = False - value = self.variable.resolve(context, True) - except VariableDoesNotExist: - no_value = True - value_missing = None - - for tests, nodelist in self.cases: - if tests is None: - return nodelist.render(context) - elif not value_missing: - for test in tests: - test_value = test.resolve(context, True) - if value == test_value: - return nodelist.render(context) - else: - return "" diff --git a/apps/picture/models.py b/apps/picture/models.py index 1e27ce68e..dd6ae8e8b 100644 --- a/apps/picture/models.py +++ b/apps/picture/models.py @@ -148,7 +148,7 @@ class Picture(models.Model): for tag in catalogue.models.Tag.objects.filter(category='author'): pics_by_author[tag] = [] - for pic in pics: + for pic in pics.iterator(): authors = list(pic.tags.filter(category='author')) if authors: for author in authors: diff --git a/apps/picture/views.py b/apps/picture/views.py index 24457e297..3f04e3c89 100644 --- a/apps/picture/views.py +++ b/apps/picture/views.py @@ -23,7 +23,7 @@ def picture_detail(request, picture): picture = get_object_or_404(Picture, slug=picture) categories = SortedDict() - for tag in picture.tags: + for tag in picture.tags.iterator(): categories.setdefault(tag.category, []).append(tag) picture_themes = [] diff --git a/apps/reporting/views.py b/apps/reporting/views.py index bf043f238..cb87f8122 100644 --- a/apps/reporting/views.py +++ b/apps/reporting/views.py @@ -21,7 +21,7 @@ def stats_page(request): annotate(count=Count('type')).\ order_by('type') for mt in media_types: - mt['size'] = sum(b.file.size for b in BookMedia.objects.filter(type=mt['type'])) + mt['size'] = sum(b.file.size for b in BookMedia.objects.filter(type=mt['type']).iterator()) if mt['type'] in ('mp3', 'ogg'): deprecated = BookMedia.objects.filter( type=mt['type'], source_sha1=None) diff --git a/apps/search/fields.py b/apps/search/fields.py index 680e618d9..45d8b7ecf 100755 --- a/apps/search/fields.py +++ b/apps/search/fields.py @@ -6,7 +6,7 @@ from django import forms from django.forms.widgets import flatatt from django.utils.encoding import smart_unicode from django.utils.safestring import mark_safe -from catalogue.fields import dumps +from json import dumps class JQueryAutoCompleteWidget(forms.TextInput): diff --git a/apps/search/views.py b/apps/search/views.py index dcd80b29f..09f217f23 100644 --- a/apps/search/views.py +++ b/apps/search/views.py @@ -10,7 +10,6 @@ from django.utils.translation import ugettext as _ from catalogue.utils import split_tags from catalogue.models import Book, Tag, Fragment -from catalogue.fields import dumps from catalogue.views import JSONResponse from search import Search, JVM, SearchResult from lucene import StringReader diff --git a/apps/social/forms.py b/apps/social/forms.py index cfa963177..5834ffa24 100755 --- a/apps/social/forms.py +++ b/apps/social/forms.py @@ -14,7 +14,8 @@ class UserSetsForm(forms.Form): def __init__(self, book, user, *args, **kwargs): super(UserSetsForm, self).__init__(*args, **kwargs) self.fields['set_ids'] = forms.ChoiceField( - choices=[(tag.id, tag.name) for tag in Tag.objects.filter(category='set', user=user)], + choices=[(tag.id, tag.name) for tag in + Tag.objects.filter(category='set', user=user).iterator()], ) @@ -28,7 +29,7 @@ class ObjectSetsForm(forms.Form): data = kwargs.setdefault('data', {}) if 'tags' not in data and user.is_authenticated(): data['tags'] = ', '.join(t.name - for t in obj.tags.filter(category='set', user=user) if t.name) + for t in obj.tags.filter(category='set', user=user).iterator() if t.name) super(ObjectSetsForm, self).__init__(*args, **kwargs) def save(self, request): diff --git a/apps/social/migrations/0001_initial.py b/apps/social/migrations/0001_initial.py index 09ccc7fc4..75ed18227 100644 --- a/apps/social/migrations/0001_initial.py +++ b/apps/social/migrations/0001_initial.py @@ -13,6 +13,7 @@ class Migration(SchemaMigration): ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('book', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['catalogue.Book'])), ('text', self.gf('django.db.models.fields.TextField')()), + ('small', self.gf('django.db.models.fields.BooleanField')(default=False)), ('vip', self.gf('django.db.models.fields.CharField')(max_length=128, null=True, blank=True)), ('link', self.gf('django.db.models.fields.URLField')(max_length=200)), )) @@ -35,7 +36,7 @@ class Migration(SchemaMigration): 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), + 'extra_info': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}), 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), @@ -52,10 +53,11 @@ class Migration(SchemaMigration): 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) }, 'social.cite': { - 'Meta': {'object_name': 'Cite'}, + 'Meta': {'ordering': "('vip', 'text')", 'object_name': 'Cite'}, 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), + 'small': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), 'text': ('django.db.models.fields.TextField', [], {}), 'vip': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}) } diff --git a/apps/social/migrations/0002_auto__add_field_cite_small.py b/apps/social/migrations/0002_auto__add_field_cite_small.py deleted file mode 100644 index 4490f74b5..000000000 --- a/apps/social/migrations/0002_auto__add_field_cite_small.py +++ /dev/null @@ -1,58 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'Cite.small' - db.add_column('social_cite', 'small', self.gf('django.db.models.fields.BooleanField')(default=False), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'Cite.small' - db.delete_column('social_cite', 'small') - - - models = { - 'catalogue.book': { - 'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'}, - '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}), - 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}), - 'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}), - 'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}), - 'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}), - 'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}), - 'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}), - 'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}), - 'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}), - 'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}), - 'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}) - }, - 'social.cite': { - 'Meta': {'object_name': 'Cite'}, - 'book': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Book']"}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'link': ('django.db.models.fields.URLField', [], {'max_length': '200'}), - 'small': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'vip': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}) - } - } - - complete_apps = ['social'] diff --git a/apps/social/migrations/__init__.py b/apps/social/migrations/__init__.py old mode 100755 new mode 100644 diff --git a/apps/sponsors/admin.py b/apps/sponsors/admin.py index 897c22159..274fe901e 100644 --- a/apps/sponsors/admin.py +++ b/apps/sponsors/admin.py @@ -3,10 +3,8 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.contrib import admin -from django.conf import settings - +from jsonfield import JSONField from sponsors import models -from sponsors import fields from sponsors import widgets @@ -18,7 +16,7 @@ class SponsorAdmin(admin.ModelAdmin): class SponsorPageAdmin(admin.ModelAdmin): formfield_overrides = { - fields.JSONField: {'widget': widgets.SponsorPageWidget}, + JSONField: {'widget': widgets.SponsorPageWidget}, } list_display = ('name',) search_fields = ('name',) diff --git a/apps/sponsors/fields.py b/apps/sponsors/fields.py deleted file mode 100644 index ba980816f..000000000 --- a/apps/sponsors/fields.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -import datetime - -from django.conf import settings -from django.db import models -from django import forms -from django.utils import simplejson as json -from south.modelsinspector import add_introspection_rules - - -class JSONEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, datetime.datetime): - return obj.strftime('%Y-%m-%d %H:%M:%S') - elif isinstance(obj, datetime.date): - return obj.strftime('%Y-%m-%d') - elif isinstance(obj, datetime.time): - return obj.strftime('%H:%M:%S') - return json.JSONEncoder.default(self, obj) - - -def dumps(data): - return JSONEncoder().encode(data) - - -def loads(str): - return json.loads(str, encoding=settings.DEFAULT_CHARSET) - - -class JSONFormField(forms.CharField): - widget = forms.Textarea - - def clean(self, value): - try: - loads(value) - return value - except ValueError, e: - raise forms.ValidationError('Enter a valid JSON value. Error: %s' % e) - - -class JSONField(models.TextField): - def formfield(self, **kwargs): - defaults = {'form_class': JSONFormField} - defaults.update(kwargs) - return super(JSONField, self).formfield(**defaults) - - def db_type(self, connection): - return 'text' - - def get_internal_type(self): - return 'TextField' - - def contribute_to_class(self, cls, name): - super(JSONField, self).contribute_to_class(cls, name) - - def get_value(model_instance): - return loads(getattr(model_instance, self.attname, None)) - setattr(cls, 'get_%s_value' % self.name, get_value) - - def set_value(model_instance, json): - return setattr(model_instance, self.attname, dumps(json)) - setattr(cls, 'set_%s_value' % self.name, set_value) - -add_introspection_rules([], [r"^sponsors\.fields\.JSONField"]) diff --git a/apps/sponsors/migrations/0001_initial.py b/apps/sponsors/migrations/0001_initial.py index daccec53b..640659532 100644 --- a/apps/sponsors/migrations/0001_initial.py +++ b/apps/sponsors/migrations/0001_initial.py @@ -7,29 +7,30 @@ from django.db import models class Migration(SchemaMigration): def forwards(self, orm): - + # Adding model 'Sponsor' db.create_table('sponsors_sponsor', ( - ('url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), - ('logo', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), - ('_description', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('name', self.gf('django.db.models.fields.CharField')(max_length=120)), + ('_description', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)), + ('logo', self.gf('django.db.models.fields.files.ImageField')(max_length=100)), + ('url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)), )) db.send_create_signal('sponsors', ['Sponsor']) # Adding model 'SponsorPage' db.create_table('sponsors_sponsorpage', ( - ('_html', self.gf('django.db.models.fields.TextField')(blank=True)), ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('sponsors', self.gf('sponsors.fields.JSONField')(default={})), ('name', self.gf('django.db.models.fields.CharField')(max_length=120)), + ('sponsors', self.gf('jsonfield.fields.JSONField')(default={})), + ('_html', self.gf('django.db.models.fields.TextField')(blank=True)), + ('sprite', self.gf('django.db.models.fields.files.ImageField')(max_length=100, blank=True)), )) db.send_create_signal('sponsors', ['SponsorPage']) def backwards(self, orm): - + # Deleting model 'Sponsor' db.delete_table('sponsors_sponsor') @@ -51,7 +52,8 @@ class Migration(SchemaMigration): '_html': ('django.db.models.fields.TextField', [], {'blank': 'True'}), 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'sponsors': ('sponsors.fields.JSONField', [], {'default': '{}'}) + 'sponsors': ('jsonfield.fields.JSONField', [], {'default': '{}'}), + 'sprite': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}) } } diff --git a/apps/sponsors/migrations/0002_auto__add_field_sponsorpage_sprite.py b/apps/sponsors/migrations/0002_auto__add_field_sponsorpage_sprite.py deleted file mode 100644 index 15b51b719..000000000 --- a/apps/sponsors/migrations/0002_auto__add_field_sponsorpage_sprite.py +++ /dev/null @@ -1,40 +0,0 @@ -# encoding: utf-8 -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Adding field 'SponsorPage.sprite' - db.add_column('sponsors_sponsorpage', 'sprite', self.gf('django.db.models.fields.files.ImageField')(default='', max_length=100, blank=True), keep_default=False) - - - def backwards(self, orm): - - # Deleting field 'SponsorPage.sprite' - db.delete_column('sponsors_sponsorpage', 'sprite') - - - models = { - 'sponsors.sponsor': { - 'Meta': {'object_name': 'Sponsor'}, - '_description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'}) - }, - 'sponsors.sponsorpage': { - 'Meta': {'object_name': 'SponsorPage'}, - '_html': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}), - 'sponsors': ('sponsors.fields.JSONField', [], {'default': '{}'}), - 'sprite': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}) - } - } - - complete_apps = ['sponsors'] diff --git a/apps/sponsors/models.py b/apps/sponsors/models.py index 1e0d2e52d..3ca1a4894 100644 --- a/apps/sponsors/models.py +++ b/apps/sponsors/models.py @@ -9,7 +9,7 @@ from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from PIL import Image -from sponsors.fields import JSONField +from jsonfield import JSONField from django.core.files.base import ContentFile THUMB_WIDTH = 120 @@ -41,7 +41,7 @@ class SponsorPage(models.Model): def populated_sponsors(self): result = [] offset = 0 - for column in self.get_sponsors_value(): + for column in self.sponsors: result_group = {'name': column['name'], 'sponsors': []} sponsor_objects = Sponsor.objects.in_bulk(column['sponsors']) for sponsor_pk in column['sponsors']: @@ -55,7 +55,7 @@ class SponsorPage(models.Model): def render_sprite(self): sponsor_ids = [] - for column in self.get_sponsors_value(): + for column in self.sponsors: sponsor_ids.extend(column['sponsors']) sponsors = Sponsor.objects.in_bulk(sponsor_ids) sprite = Image.new('RGBA', (THUMB_WIDTH, len(sponsors) * THUMB_HEIGHT)) diff --git a/apps/sponsors/widgets.py b/apps/sponsors/widgets.py index fc1387323..0ddab3809 100644 --- a/apps/sponsors/widgets.py +++ b/apps/sponsors/widgets.py @@ -23,7 +23,7 @@ class SponsorPageWidget(forms.Textarea): def render(self, name, value, attrs=None): output = [super(SponsorPageWidget, self).render(name, value, attrs)] - sponsors = [(unicode(obj), obj.pk, obj.logo.url) for obj in models.Sponsor.objects.all()] + sponsors = [(unicode(obj), obj.pk, obj.logo.url) for obj in models.Sponsor.objects.all().iterator()] sponsors_js = ', '.join('{name: "%s", id: %d, image: "%s"}' % sponsor for sponsor in sponsors) output.append(u'