@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', '')
else:
fields = all_fields
- extra_info = book.get_extra_info_value()
+ extra_info = book.extra_info
obj = {}
for field in fields:
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,
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
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:
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
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
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)
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
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'<br/>\n'.join(lines)
# 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):
# 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
('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'])
# 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'])
('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):
# 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 = {
'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'}),
},
'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'})
},
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
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
-import search
# Those are hard-coded here so that makemessages sees them.
TAG_CATEGORIES = (
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()
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)
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)
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
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):
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()))
return create_zip(paths, "%s_%s" % (self.slug, format_))
def search_index(self, book_info=None, reuse_index=False, index_tags=True):
+ import search
if reuse_index:
idx = search.ReusableIndex()
else:
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)
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())
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
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:
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:
# 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)
'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,()):
"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]
post_save.connect(_post_save_handler)
-@django.dispatch.receiver(post_delete, sender=Book)
-def _remove_book_from_index_handler(sender, instance, **kwargs):
- """ remove the book from search index, when it is deleted."""
- search.JVM.attachCurrentThread()
- idx = search.Index()
- idx.open(timeout=10000) # 10 seconds timeout.
- try:
- idx.remove_book(instance)
- idx.index_tags()
- finally:
- idx.close()
+if not settings.NO_SEARCH_INDEX:
+ @django.dispatch.receiver(post_delete, sender=Book)
+ def _remove_book_from_index_handler(sender, instance, **kwargs):
+ """ remove the book from search index, when it is deleted."""
+ import search
+ search.JVM.attachCurrentThread()
+ idx = search.Index()
+ idx.open(timeout=10000) # 10 seconds timeout.
+ try:
+ idx.remove_book(instance)
+ idx.index_tags()
+ finally:
+ idx.close()
{% load catalogue_tags %}
<p>
- {% if book.get_extra_info_value.license %}
+ {% if book.extra_info.license %}
{% trans "This work is licensed under:" %}
- <a href="{{ book.get_extra_info_value.license }}">{{ book.get_extra_info_value.license_description }}</a>
+ <a href="{{ book.extra_info.license }}">{{ book.extra_info.license_description }}</a>
{% 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
{% endif %}
</p>
-{% if book.get_extra_info_value.source_name %}
- <p>{% trans "Text prepared based on:" %} {{ book.get_extra_info_value.source_name }}</p>
+{% if book.extra_info.source_name %}
+ <p>{% trans "Text prepared based on:" %} {{ book.extra_info.source_name }}</p>
{% endif %}
-{% if book.get_extra_info_value.description %}
- <p>{{ book.get_extra_info_value.description }}</p>
+{% if book.extra_info.description %}
+ <p>{{ book.extra_info.description }}</p>
{% 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 %}
<p>{% trans "Edited and annotated by:" %}
- {% all_editors book.get_extra_info_value %}.</p>
+ {% all_editors book.extra_info %}.</p>
{% endif %}
{% if book.txt_file %}
<li><a href="{{ book.txt_file.url}}">TXT</a> {% trans "for advanced usage" %}</li>
{% endif %}
- <li><a href="{% url custom_pdf_form %}?slug={{ book.slug }}">{% trans "Download a custom PDF" %}</a></li>
+ <li><a href="{% url custom_pdf_form book.slug %}">{% trans "Download a custom PDF" %}</a></li>
</ul>
</div>
<div id="header">
</span>
<div class='play'>{{ i.mp3.name }}
<div class='extra-info'>
- {% trans "Artist" %}: <span class='artist'>{{ i.mp3.get_extra_info_value.artist_name }}</span>,
- {% trans "Director" %}: <span class='director'>{{ i.mp3.get_extra_info_value.director_name }}</span>
+ {% trans "Artist" %}: <span class='artist'>{{ i.mp3.extra_info.artist_name }}</span>,
+ {% trans "Director" %}: <span class='director'>{{ i.mp3.extra_info.director_name }}</span>
</div>
</div>
</li>
@register.tag
def catalogue_url(parser, token):
bits = token.split_contents()
- tag_name = bits[0]
tags_to_add = []
tags_to_remove = []
@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'),
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},
# 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
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
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))
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()
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'}),
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'},
'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'}),
'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'}),
'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', [], {}),
'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'}),
'view_count': ('django.db.models.fields.IntegerField', [], {'default': '1'})
}
}
-
+
complete_apps = ['lesmianator']
+++ /dev/null
-# 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']
+++ /dev/null
-# 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']
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
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
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:
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',
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
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
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)
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
+from django.conf import settings
from django.db import models
from django.db.models import permalink
from django.utils.translation import ugettext as _
from datetime import datetime
from django.db.models.signals import post_save, post_delete
-import search
class Author(models.Model):
name = models.CharField(_('name'), max_length=50, db_index=True)
return ', '.join((self.author, self.title))
-def update_index(sender, instance, **kwargs):
- print "update pd index %s [update %s]" % (instance, 'created' in kwargs)
- search.JVM.attachCurrentThread()
- idx = search.Index()
- idx.open()
- try:
- idx.index_tags(instance, remove_only=not 'created' in kwargs)
- finally:
- idx.close()
-
-post_delete.connect(update_index, Author)
-post_delete.connect(update_index, BookStub)
-post_save.connect(update_index, Author)
-post_save.connect(update_index, BookStub)
+if not settings.NO_SEARCH_INDEX:
+ def update_index(sender, instance, **kwargs):
+ import search
+ print "update pd index %s [update %s]" % (instance, 'created' in kwargs)
+ search.JVM.attachCurrentThread()
+ idx = search.Index()
+ idx.open()
+ try:
+ idx.index_tags(instance, remove_only=not 'created' in kwargs)
+ finally:
+ idx.close()
+
+ post_delete.connect(update_index, Author)
+ post_delete.connect(update_index, BookStub)
+ post_save.connect(update_index, Author)
+ post_save.connect(update_index, BookStub)
+++ /dev/null
-# 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 "<Switch node>"
-
- 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 ""
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:
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 = []
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)
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):
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
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()],
)
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):
('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)),
))
'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'}),
'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'})
}
+++ /dev/null
-# 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']
# 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
class SponsorPageAdmin(admin.ModelAdmin):
formfield_overrides = {
- fields.JSONField: {'widget': widgets.SponsorPageWidget},
+ JSONField: {'widget': widgets.SponsorPageWidget},
}
list_display = ('name',)
search_fields = ('name',)
+++ /dev/null
-# -*- 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"])
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')
'_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'})
}
}
+++ /dev/null
-# 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']
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
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']:
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))
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'<script type="text/javascript">addEvent(window, "load", function(e) {')
# TODO: "id_" is hard-coded here. This should instead use the correct
from waiter.settings import WAITER_URL
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse
+from django.views.decorators.cache import never_cache
+
+@never_cache
def wait(request, path):
if WaitedFile.exists(path):
file_url = join(WAITER_URL, path)
e-mail: <a href="mailto:fundacja@nowoczesnapolska.org.pl">fundacja@nowoczesnapolska.org.pl</a>
{% endblocktrans %}
</p>
+ <p>Nowa strona biblioteki Wolne Lektury powstała dzięki środkom otrzymanym w ramach Programu Operacyjnego Fundusz Inicjatyw Obywatelskich, Senatu RP (zadanie realizowane w ramach zlecania przez Kancelarię Senatu zadań w zakresie opieki nad Polonią i Polakami za granicą w 2011 r.) oraz Narodowego Instytutu Audiowizualnego w ramach programu Dziedzictwo Cyfrowe.</p>
{% block add_footer %}{% endblock %}
"Install the required packages from the requirements file using pip"
print '>>> install requirements'
require('release', provided_by=[deploy])
- run('cd %(path)s; %(pip)s install -E . -r %(path)s/releases/%(release)s/requirements.txt' % env, pty=True)
+ run('cd %(path)s; %(pip)s install -E ve -r %(path)s/releases/%(release)s/requirements.txt' % env, pty=True)
def copy_localsettings():
"Copy localsettings.py from root directory to release directory (if this file exists)"
print '>>> migrate'
require('project_name', provided_by=[staging, production])
with cd('%(path)s/releases/current/%(project_name)s' % env):
- run('../../../bin/python manage.py syncdb --noinput' % env, pty=True)
+ run('../../../ve/bin/python manage.py syncdb --noinput' % env, pty=True)
if env.use_south:
- run('../../../bin/python manage.py migrate' % env, pty=True)
+ run('../../../ve/bin/python manage.py migrate' % env, pty=True)
def restart_webserver():
"Restart the web server"
; =========================================
[program:celery.%(project_name)s]
-command=%(path)s/bin/python %(path)s/releases/current/%(project_name)s/manage.py celeryd --loglevel=INFO
+command=%(path)s/ve/bin/python %(path)s/releases/current/%(project_name)s/manage.py celeryd --loglevel=INFO
directory=%(path)s/releases/current/%(project_name)s
user=%(user)s
numprocs=2
#!%(python)s
import site
-site.addsitedir('%(path)s/lib/python2.6/site-packages')
+site.addsitedir('%(path)s/ve/lib/python2.6/site-packages')
import os
from os.path import abspath, dirname, join
'stats',
'suggest',
'picture',
- 'search',
'social',
'waiter',
]
LOGIN_REDIRECT_URL = '/'
-SOCIALACCOUNT_AUTO_SIGNUP = False
\ No newline at end of file
+SOCIALACCOUNT_AUTO_SIGNUP = False
+SOCIALACCOUNT_QUERY_EMAIL = True