diff --git a/cms_helper.py b/cms_helper.py index c4c7a37..e8f561b 100644 --- a/cms_helper.py +++ b/cms_helper.py @@ -73,6 +73,11 @@ HELPER_SETTINGS = { 'MIDDLEWARE_CLASSES': [ 'django.contrib.messages.middleware.MessageMiddleware', ], + 'MIGRATION_MODULES': { + 'filer': 'filer.migrations_django', + 'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django', + 'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django', + }, 'META_SITE_PROTOCOL': 'http', 'META_SITE_DOMAIN': 'example.com', 'META_USE_OG_PROPERTIES': True, @@ -88,4 +93,4 @@ HELPER_SETTINGS = { 'SITE_ID': 1 } if 'test' in sys.argv: - HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose') \ No newline at end of file + HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose') diff --git a/djangocms_blog/admin.py b/djangocms_blog/admin.py index ca76cbd..61bcb9a 100755 --- a/djangocms_blog/admin.py +++ b/djangocms_blog/admin.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- from admin_enhancer.admin import EnhancedModelAdminMixin -from cms.admin.placeholderadmin import PlaceholderAdmin, FrontendEditableAdmin +from cms.admin.placeholderadmin import PlaceholderAdminMixin, FrontendEditableAdminMixin from copy import deepcopy from django.contrib import admin from django.conf import settings @@ -23,8 +23,8 @@ class BlogCategoryAdmin(EnhancedModelAdminMixin, TranslatableAdmin): } -class PostAdmin(EnhancedModelAdminMixin, FrontendEditableAdmin, - PlaceholderAdmin, TranslatableAdmin): +class PostAdmin(EnhancedModelAdminMixin, FrontendEditableAdminMixin, + PlaceholderAdminMixin, TranslatableAdmin, admin.ModelAdmin): form = PostAdminForm list_display = ['title', 'author', 'date_published', 'date_published_end'] date_hierarchy = 'date_published' diff --git a/djangocms_blog/migrations/0001_initial.py b/djangocms_blog/migrations/0001_initial.py index b3087dc..f6769fa 100644 --- a/djangocms_blog/migrations/0001_initial.py +++ b/djangocms_blog/migrations/0001_initial.py @@ -1,342 +1,136 @@ # -*- coding: utf-8 -*- -from django.contrib.auth import get_user_model -from django.utils import timezone -from south.db import db -from south.v2 import SchemaMigration -from django.db import models +from __future__ import unicode_literals + +from django.db import models, migrations +import taggit_autosuggest.managers +import filer.fields.image +import meta_mixin.models +import djangocms_text_ckeditor.fields +import cms.models.fields +import django.utils.timezone +from django.conf import settings +from django.conf import settings -User = get_user_model() -user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name) -user_model_label = '%s.%s' % (User._meta.app_label, User._meta.module_name) +class Migration(migrations.Migration): + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('cms', '0003_auto_20140926_2347'), + ('taggit', '__first__'), + ('filer', '0001_initial'), + ('cmsplugin_filer_image', '0001_initial'), + ] -class Migration(SchemaMigration): - - def forwards(self, orm): - # Adding model 'BlogCategoryTranslation' - db.create_table(u'djangocms_blog_blogcategory_translation', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('language_code', self.gf('django.db.models.fields.CharField')(max_length=15, db_index=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=200)), - ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50, blank=True, db_index=True)), - ('master', self.gf('django.db.models.fields.related.ForeignKey')(related_name='translations', null=True, to=orm['djangocms_blog.BlogCategory'])), - )) - db.send_create_signal(u'djangocms_blog', ['BlogCategoryTranslation']) - - # Adding unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'slug'] - db.create_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'slug']) - - # Adding unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'master'] - db.create_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'master_id']) - - # Adding model 'BlogCategory' - db.create_table(u'djangocms_blog_blogcategory', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['djangocms_blog.BlogCategory'], null=True, blank=True)), - ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('date_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - )) - db.send_create_signal(u'djangocms_blog', ['BlogCategory']) - - # Adding model 'PostTranslation' - db.create_table(u'djangocms_blog_post_translation', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('language_code', self.gf('django.db.models.fields.CharField')(max_length=15, db_index=True)), - ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), - ('slug', self.gf('django.db.models.fields.SlugField')(db_index=True, max_length=50, blank=True)), - ('abstract', self.gf('djangocms_text_ckeditor.fields.HTMLField')()), - ('master', self.gf('django.db.models.fields.related.ForeignKey')(related_name='translations', null=True, to=orm['djangocms_blog.Post'])), - )) - db.send_create_signal(u'djangocms_blog', ['PostTranslation']) - - # Adding unique constraint on 'PostTranslation', fields ['language_code', 'slug'] - db.create_unique(u'djangocms_blog_post_translation', ['language_code', 'slug']) - - # Adding unique constraint on 'PostTranslation', fields ['language_code', 'master'] - db.create_unique(u'djangocms_blog_post_translation', ['language_code', 'master_id']) - - # Adding model 'Post' - db.create_table(u'djangocms_blog_post', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm[user_orm_label])), - ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), - ('date_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), - ('date_published', self.gf('django.db.models.fields.DateTimeField')(default=timezone.now)), - ('date_published_end', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), - ('publish', self.gf('django.db.models.fields.BooleanField')(default=False)), - ('main_image', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, blank=True)), - ('main_image_thumbnail', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='blog_post_thumbnail', null=True, to=orm['cmsplugin_filer_image.ThumbnailOption'])), - ('main_image_full', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='blog_post_full', null=True, to=orm['cmsplugin_filer_image.ThumbnailOption'])), - ('content', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['cms.Placeholder'], null=True)), - )) - db.send_create_signal(u'djangocms_blog', ['Post']) - - # Adding M2M table for field categories on 'Post' - m2m_table_name = db.shorten_name(u'djangocms_blog_post_categories') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('post', models.ForeignKey(orm[u'djangocms_blog.post'], null=False)), - ('blogcategory', models.ForeignKey(orm[u'djangocms_blog.blogcategory'], null=False)) - )) - db.create_unique(m2m_table_name, ['post_id', 'blogcategory_id']) - - # Adding model 'LatestPostsPlugin' - db.create_table(u'cmsplugin_latestpostsplugin', ( - (u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), - ('latest_posts', self.gf('django.db.models.fields.IntegerField')(default=5)), - )) - db.send_create_signal(u'djangocms_blog', ['LatestPostsPlugin']) - - # Adding M2M table for field tags on 'LatestPostsPlugin' - m2m_table_name = db.shorten_name(u'djangocms_blog_latestpostsplugin_tags') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('latestpostsplugin', models.ForeignKey(orm[u'djangocms_blog.latestpostsplugin'], null=False)), - ('tag', models.ForeignKey(orm[u'taggit.tag'], null=False)) - )) - db.create_unique(m2m_table_name, ['latestpostsplugin_id', 'tag_id']) - - # Adding M2M table for field categories on 'LatestPostsPlugin' - m2m_table_name = db.shorten_name(u'djangocms_blog_latestpostsplugin_categories') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('latestpostsplugin', models.ForeignKey(orm[u'djangocms_blog.latestpostsplugin'], null=False)), - ('blogcategory', models.ForeignKey(orm[u'djangocms_blog.blogcategory'], null=False)) - )) - db.create_unique(m2m_table_name, ['latestpostsplugin_id', 'blogcategory_id']) - - # Adding model 'AuthorEntriesPlugin' - db.create_table(u'cmsplugin_authorentriesplugin', ( - (u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), - ('latest_posts', self.gf('django.db.models.fields.IntegerField')(default=5)), - )) - db.send_create_signal(u'djangocms_blog', ['AuthorEntriesPlugin']) - - # Adding M2M table for field authors on 'AuthorEntriesPlugin' - m2m_table_name = db.shorten_name(u'djangocms_blog_authorentriesplugin_authors') - db.create_table(m2m_table_name, ( - ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), - ('authorentriesplugin', models.ForeignKey(orm[u'djangocms_blog.authorentriesplugin'], null=False)), - ('user', models.ForeignKey(orm[user_orm_label], null=False)) - )) - db.create_unique(m2m_table_name, ['authorentriesplugin_id', 'user_id']) - - - def backwards(self, orm): - # Removing unique constraint on 'PostTranslation', fields ['language_code', 'master'] - db.delete_unique(u'djangocms_blog_post_translation', ['language_code', 'master_id']) - - # Removing unique constraint on 'PostTranslation', fields ['language_code', 'slug'] - db.delete_unique(u'djangocms_blog_post_translation', ['language_code', 'slug']) - - # Removing unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'master'] - db.delete_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'master_id']) - - # Removing unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'slug'] - db.delete_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'slug']) - - # Deleting model 'BlogCategoryTranslation' - db.delete_table(u'djangocms_blog_blogcategory_translation') - - # Deleting model 'BlogCategory' - db.delete_table(u'djangocms_blog_blogcategory') - - # Deleting model 'PostTranslation' - db.delete_table(u'djangocms_blog_post_translation') - - # Deleting model 'Post' - db.delete_table(u'djangocms_blog_post') - - # Removing M2M table for field categories on 'Post' - db.delete_table(db.shorten_name(u'djangocms_blog_post_categories')) - - # Deleting model 'LatestPostsPlugin' - db.delete_table(u'cmsplugin_latestpostsplugin') - - # Removing M2M table for field tags on 'LatestPostsPlugin' - db.delete_table(db.shorten_name(u'djangocms_blog_latestpostsplugin_tags')) - - # Removing M2M table for field categories on 'LatestPostsPlugin' - db.delete_table(db.shorten_name(u'djangocms_blog_latestpostsplugin_categories')) - - # Deleting model 'AuthorEntriesPlugin' - db.delete_table(u'cmsplugin_authorentriesplugin') - - # Removing M2M table for field authors on 'AuthorEntriesPlugin' - db.delete_table(db.shorten_name(u'djangocms_blog_authorentriesplugin_authors')) - - - models = { - u'auth.group': { - 'Meta': {'object_name': 'Group'}, - u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'auth.permission': { - 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, - 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) - }, - user_model_label: { - 'Meta': {'object_name': User.__name__, 'db_table': "'%s'" % User._meta.db_table}, - '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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), - u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), - 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) - }, - 'cms.cmsplugin': { - 'Meta': {'object_name': 'CMSPlugin'}, - 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), - 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), - 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), - 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), - 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) - }, - 'cms.placeholder': { - 'Meta': {'object_name': 'Placeholder'}, - 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}) - }, - u'cmsplugin_filer_image.thumbnailoption': { - 'Meta': {'ordering': "('width', 'height')", 'object_name': 'ThumbnailOption'}, - 'crop': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'height': ('django.db.models.fields.IntegerField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), - 'upscale': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'width': ('django.db.models.fields.IntegerField', [], {}) - }, - u'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'}), - u'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'}) - }, - u'djangocms_blog.authorentriesplugin': { - 'Meta': {'object_name': 'AuthorEntriesPlugin', 'db_table': "u'cmsplugin_authorentriesplugin'", '_ormbases': ['cms.CMSPlugin']}, - 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % user_orm_label, 'symmetrical': 'False'}), - u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), - 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'}) - }, - u'djangocms_blog.blogcategory': { - 'Meta': {'object_name': 'BlogCategory'}, - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'date_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['djangocms_blog.BlogCategory']", 'null': 'True', 'blank': 'True'}) - }, - u'djangocms_blog.blogcategorytranslation': { - 'Meta': {'unique_together': "[('language_code', 'slug'), ('language_code', 'master')]", 'object_name': 'BlogCategoryTranslation', 'db_table': "u'djangocms_blog_blogcategory_translation'"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'null': 'True', 'to': u"orm['djangocms_blog.BlogCategory']"}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}) - }, - u'djangocms_blog.latestpostsplugin': { - 'Meta': {'object_name': 'LatestPostsPlugin', 'db_table': "u'cmsplugin_latestpostsplugin'", '_ormbases': ['cms.CMSPlugin']}, - 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['djangocms_blog.BlogCategory']", 'symmetrical': 'False', 'blank': 'True'}), - u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), - 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'}), - 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['taggit.Tag']", 'symmetrical': 'False', 'blank': 'True'}) - }, - u'djangocms_blog.post': { - 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['%s']" % user_orm_label}), - 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'blog_posts'", 'symmetrical': 'False', 'to': u"orm['djangocms_blog.BlogCategory']"}), - 'content': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), - 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - 'date_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'date_published': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), - 'date_published_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'main_image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'blank': 'True'}), - 'main_image_full': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'blog_post_full'", 'null': 'True', 'to': u"orm['cmsplugin_filer_image.ThumbnailOption']"}), - 'main_image_thumbnail': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'blog_post_thumbnail'", 'null': 'True', 'to': u"orm['cmsplugin_filer_image.ThumbnailOption']"}), - 'publish': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) - }, - u'djangocms_blog.posttranslation': { - 'Meta': {'unique_together': "[('language_code', 'slug'), ('language_code', 'master')]", 'object_name': 'PostTranslation', 'db_table': "u'djangocms_blog_post_translation'"}, - 'abstract': ('djangocms_text_ckeditor.fields.HTMLField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), - 'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'null': 'True', 'to': u"orm['djangocms_blog.Post']"}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'blank': 'True'}), - 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) - }, - 'filer.file': { - 'Meta': {'object_name': 'File'}, - '_file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), - 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'folder': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'all_files'", 'null': 'True', 'to': "orm['filer.Folder']"}), - 'has_all_mandatory_data': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), - 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), - 'original_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': u"orm['%s']" % user_orm_label}), - 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'polymorphic_filer.file_set'", 'null': 'True', 'to': u"orm['contenttypes.ContentType']"}), - 'sha1': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40', 'blank': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'filer.folder': { - 'Meta': {'ordering': "('name',)", 'unique_together': "(('parent', 'name'),)", 'object_name': 'Folder'}, - 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - u'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), - 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % user_orm_label}), - 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['filer.Folder']"}), - u'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), - 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) - }, - 'filer.image': { - 'Meta': {'object_name': 'Image', '_ormbases': ['filer.File']}, - '_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - '_width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), - 'author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), - 'default_alt_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - 'default_caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), - u'file_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['filer.File']", 'unique': 'True', 'primary_key': 'True'}), - 'must_always_publish_author_credit': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'must_always_publish_copyright': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), - 'related_url': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), - 'subject_location': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'blank': 'True'}) - }, - u'taggit.tag': { - 'Meta': {'object_name': 'Tag'}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), - 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) - } - } - - complete_apps = ['djangocms_blog'] + operations = [ + migrations.CreateModel( + name='AuthorEntriesPlugin', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('latest_posts', models.IntegerField(default=5, help_text='The number of author articles to be displayed.', verbose_name='Articles')), + ('authors', models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='Authors')), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='BlogCategory', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('date_created', models.DateTimeField(auto_now_add=True, verbose_name='created at')), + ('date_modified', models.DateTimeField(auto_now=True, verbose_name='modified at')), + ('parent', models.ForeignKey(verbose_name='parent', blank=True, to='djangocms_blog.BlogCategory', null=True)), + ], + options={ + 'verbose_name': 'blog category', + 'verbose_name_plural': 'blog categories', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='BlogCategoryTranslation', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language', choices=settings.LANGUAGES)), + ('name', models.CharField(max_length=255, verbose_name='name')), + ('slug', models.SlugField(verbose_name='slug', blank=True)), + ('master', models.ForeignKey(related_name='translations', editable=False, to='djangocms_blog.BlogCategory', null=True)), + ], + options={ + 'db_table': 'djangocms_blog_blogcategory_translation', + 'verbose_name': 'blog category Translation', + 'default_permissions': (), + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='LatestPostsPlugin', + fields=[ + ('cmsplugin_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='cms.CMSPlugin')), + ('latest_posts', models.IntegerField(default=5, help_text='The number of latests articles to be displayed.', verbose_name='Articles')), + ('categories', models.ManyToManyField(help_text='Show only the blog articles tagged with chosen categories.', to='djangocms_blog.BlogCategory', blank=True)), + ('tags', models.ManyToManyField(help_text='Show only the blog articles tagged with chosen tags.', to='taggit.Tag', blank=True)), + ], + options={ + 'abstract': False, + }, + bases=('cms.cmsplugin',), + ), + migrations.CreateModel( + name='Post', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('date_created', models.DateTimeField(auto_now_add=True)), + ('date_modified', models.DateTimeField(auto_now=True)), + ('date_published', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Published Since')), + ('date_published_end', models.DateTimeField(null=True, verbose_name='Published Until', blank=True)), + ('publish', models.BooleanField(default=False, verbose_name='Publish')), + ('enable_comments', models.BooleanField(default=True, verbose_name='Enable comments on post')), + ('author', models.ForeignKey(related_name='djangocms_blog_post_author', verbose_name='Author', blank=True, to=settings.AUTH_USER_MODEL, null=True)), + ('categories', models.ManyToManyField(related_name='blog_posts', verbose_name='category', to='djangocms_blog.BlogCategory')), + ('content', cms.models.fields.PlaceholderField(slotname=b'post_content', editable=False, to='cms.Placeholder', null=True)), + ('main_image', filer.fields.image.FilerImageField(related_name='djangocms_blog_post_image', verbose_name='Main image', blank=True, to='filer.Image', null=True)), + ('main_image_full', models.ForeignKey(related_name='djangocms_blog_post_full', verbose_name='Main image full', blank=True, to='cmsplugin_filer_image.ThumbnailOption', null=True)), + ('main_image_thumbnail', models.ForeignKey(related_name='djangocms_blog_post_thumbnail', verbose_name='Main image thumbnail', blank=True, to='cmsplugin_filer_image.ThumbnailOption', null=True)), + ('tags', taggit_autosuggest.managers.TaggableManager(to='taggit.Tag', through='taggit.TaggedItem', blank=True, help_text='A comma-separated list of tags.', verbose_name='Tags')), + ], + options={ + 'ordering': ('-date_published', '-date_created'), + 'get_latest_by': 'date_published', + 'verbose_name': 'blog article', + 'verbose_name_plural': 'blog articles', + }, + bases=(meta_mixin.models.ModelMeta, models.Model), + ), + migrations.CreateModel( + name='PostTranslation', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language', choices=settings.LANGUAGES)), + ('title', models.CharField(max_length=255, verbose_name='Title')), + ('slug', models.SlugField(verbose_name='slug', blank=True)), + ('abstract', djangocms_text_ckeditor.fields.HTMLField(verbose_name='Abstract')), + ('meta_description', models.TextField(default=b'', verbose_name='Post meta description', blank=True)), + ('meta_keywords', models.TextField(default=b'', verbose_name='Post meta keywords', blank=True)), + ('meta_title', models.CharField(default=b'', help_text='used in title tag and social sharing', max_length=255, verbose_name='Post meta title', blank=True)), + ('post_text', djangocms_text_ckeditor.fields.HTMLField(default=b'', verbose_name='Text', blank=True)), + ('master', models.ForeignKey(related_name='translations', editable=False, to='djangocms_blog.Post', null=True)), + ], + options={ + 'db_table': 'djangocms_blog_post_translation', + 'verbose_name': 'blog article Translation', + 'default_permissions': (), + }, + bases=(models.Model,), + ), + migrations.AlterUniqueTogether( + name='posttranslation', + unique_together=set([('language_code', 'master'), ('language_code', 'slug')]), + ), + migrations.AlterUniqueTogether( + name='blogcategorytranslation', + unique_together=set([('language_code', 'master'), ('language_code', 'slug')]), + ), + ] diff --git a/djangocms_blog/migrations/0002_post_sites.py b/djangocms_blog/migrations/0002_post_sites.py new file mode 100644 index 0000000..3f973ab --- /dev/null +++ b/djangocms_blog/migrations/0002_post_sites.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('sites', '0001_initial'), + ('djangocms_blog', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='post', + name='sites', + field=models.ManyToManyField(help_text='Select sites in which to show the post. If none is set it will bevisible in all the configured sites.', to='sites.Site', null=True, verbose_name='Site(s', blank=True), + preserve_default=True, + ), + ] diff --git a/djangocms_blog/migrations/0003_auto_20141201_2252.py b/djangocms_blog/migrations/0003_auto_20141201_2252.py new file mode 100644 index 0000000..f59bbd3 --- /dev/null +++ b/djangocms_blog/migrations/0003_auto_20141201_2252.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('djangocms_blog', '0002_post_sites'), + ] + + operations = [ + migrations.AlterField( + model_name='post', + name='sites', + field=models.ManyToManyField(help_text='Select sites in which to show the post. If none is set it will be visible in all the configured sites.', to='sites.Site', null=True, verbose_name='Site(s)', blank=True), + preserve_default=True, + ), + ] diff --git a/djangocms_blog/south_migrations/0001_initial.py b/djangocms_blog/south_migrations/0001_initial.py new file mode 100644 index 0000000..b3087dc --- /dev/null +++ b/djangocms_blog/south_migrations/0001_initial.py @@ -0,0 +1,342 @@ +# -*- coding: utf-8 -*- +from django.contrib.auth import get_user_model +from django.utils import timezone +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +User = get_user_model() +user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name) +user_model_label = '%s.%s' % (User._meta.app_label, User._meta.module_name) + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding model 'BlogCategoryTranslation' + db.create_table(u'djangocms_blog_blogcategory_translation', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('language_code', self.gf('django.db.models.fields.CharField')(max_length=15, db_index=True)), + ('name', self.gf('django.db.models.fields.CharField')(max_length=200)), + ('slug', self.gf('django.db.models.fields.SlugField')(max_length=50, blank=True, db_index=True)), + ('master', self.gf('django.db.models.fields.related.ForeignKey')(related_name='translations', null=True, to=orm['djangocms_blog.BlogCategory'])), + )) + db.send_create_signal(u'djangocms_blog', ['BlogCategoryTranslation']) + + # Adding unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'slug'] + db.create_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'slug']) + + # Adding unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'master'] + db.create_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'master_id']) + + # Adding model 'BlogCategory' + db.create_table(u'djangocms_blog_blogcategory', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('parent', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['djangocms_blog.BlogCategory'], null=True, blank=True)), + ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('date_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), + )) + db.send_create_signal(u'djangocms_blog', ['BlogCategory']) + + # Adding model 'PostTranslation' + db.create_table(u'djangocms_blog_post_translation', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('language_code', self.gf('django.db.models.fields.CharField')(max_length=15, db_index=True)), + ('title', self.gf('django.db.models.fields.CharField')(max_length=255)), + ('slug', self.gf('django.db.models.fields.SlugField')(db_index=True, max_length=50, blank=True)), + ('abstract', self.gf('djangocms_text_ckeditor.fields.HTMLField')()), + ('master', self.gf('django.db.models.fields.related.ForeignKey')(related_name='translations', null=True, to=orm['djangocms_blog.Post'])), + )) + db.send_create_signal(u'djangocms_blog', ['PostTranslation']) + + # Adding unique constraint on 'PostTranslation', fields ['language_code', 'slug'] + db.create_unique(u'djangocms_blog_post_translation', ['language_code', 'slug']) + + # Adding unique constraint on 'PostTranslation', fields ['language_code', 'master'] + db.create_unique(u'djangocms_blog_post_translation', ['language_code', 'master_id']) + + # Adding model 'Post' + db.create_table(u'djangocms_blog_post', ( + (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('author', self.gf('django.db.models.fields.related.ForeignKey')(to=orm[user_orm_label])), + ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)), + ('date_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), + ('date_published', self.gf('django.db.models.fields.DateTimeField')(default=timezone.now)), + ('date_published_end', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)), + ('publish', self.gf('django.db.models.fields.BooleanField')(default=False)), + ('main_image', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['filer.Image'], null=True, blank=True)), + ('main_image_thumbnail', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='blog_post_thumbnail', null=True, to=orm['cmsplugin_filer_image.ThumbnailOption'])), + ('main_image_full', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='blog_post_full', null=True, to=orm['cmsplugin_filer_image.ThumbnailOption'])), + ('content', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['cms.Placeholder'], null=True)), + )) + db.send_create_signal(u'djangocms_blog', ['Post']) + + # Adding M2M table for field categories on 'Post' + m2m_table_name = db.shorten_name(u'djangocms_blog_post_categories') + db.create_table(m2m_table_name, ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('post', models.ForeignKey(orm[u'djangocms_blog.post'], null=False)), + ('blogcategory', models.ForeignKey(orm[u'djangocms_blog.blogcategory'], null=False)) + )) + db.create_unique(m2m_table_name, ['post_id', 'blogcategory_id']) + + # Adding model 'LatestPostsPlugin' + db.create_table(u'cmsplugin_latestpostsplugin', ( + (u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), + ('latest_posts', self.gf('django.db.models.fields.IntegerField')(default=5)), + )) + db.send_create_signal(u'djangocms_blog', ['LatestPostsPlugin']) + + # Adding M2M table for field tags on 'LatestPostsPlugin' + m2m_table_name = db.shorten_name(u'djangocms_blog_latestpostsplugin_tags') + db.create_table(m2m_table_name, ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('latestpostsplugin', models.ForeignKey(orm[u'djangocms_blog.latestpostsplugin'], null=False)), + ('tag', models.ForeignKey(orm[u'taggit.tag'], null=False)) + )) + db.create_unique(m2m_table_name, ['latestpostsplugin_id', 'tag_id']) + + # Adding M2M table for field categories on 'LatestPostsPlugin' + m2m_table_name = db.shorten_name(u'djangocms_blog_latestpostsplugin_categories') + db.create_table(m2m_table_name, ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('latestpostsplugin', models.ForeignKey(orm[u'djangocms_blog.latestpostsplugin'], null=False)), + ('blogcategory', models.ForeignKey(orm[u'djangocms_blog.blogcategory'], null=False)) + )) + db.create_unique(m2m_table_name, ['latestpostsplugin_id', 'blogcategory_id']) + + # Adding model 'AuthorEntriesPlugin' + db.create_table(u'cmsplugin_authorentriesplugin', ( + (u'cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)), + ('latest_posts', self.gf('django.db.models.fields.IntegerField')(default=5)), + )) + db.send_create_signal(u'djangocms_blog', ['AuthorEntriesPlugin']) + + # Adding M2M table for field authors on 'AuthorEntriesPlugin' + m2m_table_name = db.shorten_name(u'djangocms_blog_authorentriesplugin_authors') + db.create_table(m2m_table_name, ( + ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), + ('authorentriesplugin', models.ForeignKey(orm[u'djangocms_blog.authorentriesplugin'], null=False)), + ('user', models.ForeignKey(orm[user_orm_label], null=False)) + )) + db.create_unique(m2m_table_name, ['authorentriesplugin_id', 'user_id']) + + + def backwards(self, orm): + # Removing unique constraint on 'PostTranslation', fields ['language_code', 'master'] + db.delete_unique(u'djangocms_blog_post_translation', ['language_code', 'master_id']) + + # Removing unique constraint on 'PostTranslation', fields ['language_code', 'slug'] + db.delete_unique(u'djangocms_blog_post_translation', ['language_code', 'slug']) + + # Removing unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'master'] + db.delete_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'master_id']) + + # Removing unique constraint on 'BlogCategoryTranslation', fields ['language_code', 'slug'] + db.delete_unique(u'djangocms_blog_blogcategory_translation', ['language_code', 'slug']) + + # Deleting model 'BlogCategoryTranslation' + db.delete_table(u'djangocms_blog_blogcategory_translation') + + # Deleting model 'BlogCategory' + db.delete_table(u'djangocms_blog_blogcategory') + + # Deleting model 'PostTranslation' + db.delete_table(u'djangocms_blog_post_translation') + + # Deleting model 'Post' + db.delete_table(u'djangocms_blog_post') + + # Removing M2M table for field categories on 'Post' + db.delete_table(db.shorten_name(u'djangocms_blog_post_categories')) + + # Deleting model 'LatestPostsPlugin' + db.delete_table(u'cmsplugin_latestpostsplugin') + + # Removing M2M table for field tags on 'LatestPostsPlugin' + db.delete_table(db.shorten_name(u'djangocms_blog_latestpostsplugin_tags')) + + # Removing M2M table for field categories on 'LatestPostsPlugin' + db.delete_table(db.shorten_name(u'djangocms_blog_latestpostsplugin_categories')) + + # Deleting model 'AuthorEntriesPlugin' + db.delete_table(u'cmsplugin_authorentriesplugin') + + # Removing M2M table for field authors on 'AuthorEntriesPlugin' + db.delete_table(db.shorten_name(u'djangocms_blog_authorentriesplugin_authors')) + + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'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': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + user_model_label: { + 'Meta': {'object_name': User.__name__, 'db_table': "'%s'" % User._meta.db_table}, + '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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}), + u'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', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'cms.cmsplugin': { + 'Meta': {'object_name': 'CMSPlugin'}, + 'changed_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), + 'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}), + 'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), + 'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}), + 'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}), + 'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}) + }, + 'cms.placeholder': { + 'Meta': {'object_name': 'Placeholder'}, + 'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}) + }, + u'cmsplugin_filer_image.thumbnailoption': { + 'Meta': {'ordering': "('width', 'height')", 'object_name': 'ThumbnailOption'}, + 'crop': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'height': ('django.db.models.fields.IntegerField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'upscale': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'width': ('django.db.models.fields.IntegerField', [], {}) + }, + u'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'}), + u'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'}) + }, + u'djangocms_blog.authorentriesplugin': { + 'Meta': {'object_name': 'AuthorEntriesPlugin', 'db_table': "u'cmsplugin_authorentriesplugin'", '_ormbases': ['cms.CMSPlugin']}, + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % user_orm_label, 'symmetrical': 'False'}), + u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), + 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'}) + }, + u'djangocms_blog.blogcategory': { + 'Meta': {'object_name': 'BlogCategory'}, + 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'date_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['djangocms_blog.BlogCategory']", 'null': 'True', 'blank': 'True'}) + }, + u'djangocms_blog.blogcategorytranslation': { + 'Meta': {'unique_together': "[('language_code', 'slug'), ('language_code', 'master')]", 'object_name': 'BlogCategoryTranslation', 'db_table': "u'djangocms_blog_blogcategory_translation'"}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), + 'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'null': 'True', 'to': u"orm['djangocms_blog.BlogCategory']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'blank': 'True'}) + }, + u'djangocms_blog.latestpostsplugin': { + 'Meta': {'object_name': 'LatestPostsPlugin', 'db_table': "u'cmsplugin_latestpostsplugin'", '_ormbases': ['cms.CMSPlugin']}, + 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['djangocms_blog.BlogCategory']", 'symmetrical': 'False', 'blank': 'True'}), + u'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}), + 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['taggit.Tag']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'djangocms_blog.post': { + 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['%s']" % user_orm_label}), + 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'blog_posts'", 'symmetrical': 'False', 'to': u"orm['djangocms_blog.BlogCategory']"}), + 'content': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}), + 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'date_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'date_published': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'date_published_end': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'main_image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['filer.Image']", 'null': 'True', 'blank': 'True'}), + 'main_image_full': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'blog_post_full'", 'null': 'True', 'to': u"orm['cmsplugin_filer_image.ThumbnailOption']"}), + 'main_image_thumbnail': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'blog_post_thumbnail'", 'null': 'True', 'to': u"orm['cmsplugin_filer_image.ThumbnailOption']"}), + 'publish': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + u'djangocms_blog.posttranslation': { + 'Meta': {'unique_together': "[('language_code', 'slug'), ('language_code', 'master')]", 'object_name': 'PostTranslation', 'db_table': "u'djangocms_blog_post_translation'"}, + 'abstract': ('djangocms_text_ckeditor.fields.HTMLField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language_code': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}), + 'master': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'null': 'True', 'to': u"orm['djangocms_blog.Post']"}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'blank': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'filer.file': { + 'Meta': {'object_name': 'File'}, + '_file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'folder': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'all_files'", 'null': 'True', 'to': "orm['filer.Folder']"}), + 'has_all_mandatory_data': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', 'blank': 'True'}), + 'original_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': u"orm['%s']" % user_orm_label}), + 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'polymorphic_filer.file_set'", 'null': 'True', 'to': u"orm['contenttypes.ContentType']"}), + 'sha1': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '40', 'blank': 'True'}), + 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) + }, + 'filer.folder': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('parent', 'name'),)", 'object_name': 'Folder'}, + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + u'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % user_orm_label}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['filer.Folder']"}), + u'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), + 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) + }, + 'filer.image': { + 'Meta': {'object_name': 'Image', '_ormbases': ['filer.File']}, + '_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + '_width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'default_alt_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'default_caption': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + u'file_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['filer.File']", 'unique': 'True', 'primary_key': 'True'}), + 'must_always_publish_author_credit': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'must_always_publish_copyright': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'related_url': ('django.db.models.fields.CharField', [], {'max_length': '250', 'null': 'True', 'blank': 'True'}), + 'subject_location': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '64', 'null': 'True', 'blank': 'True'}) + }, + u'taggit.tag': { + 'Meta': {'object_name': 'Tag'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) + } + } + + complete_apps = ['djangocms_blog'] diff --git a/djangocms_blog/migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py b/djangocms_blog/south_migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py similarity index 100% rename from djangocms_blog/migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py rename to djangocms_blog/south_migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py diff --git a/djangocms_blog/migrations/0003_rename_plugins.py b/djangocms_blog/south_migrations/0003_rename_plugins.py similarity index 100% rename from djangocms_blog/migrations/0003_rename_plugins.py rename to djangocms_blog/south_migrations/0003_rename_plugins.py diff --git a/djangocms_blog/migrations/0004_auto__add_field_posttranslation_meta_description.py b/djangocms_blog/south_migrations/0004_auto__add_field_posttranslation_meta_description.py similarity index 100% rename from djangocms_blog/migrations/0004_auto__add_field_posttranslation_meta_description.py rename to djangocms_blog/south_migrations/0004_auto__add_field_posttranslation_meta_description.py diff --git a/djangocms_blog/migrations/0005_auto__add_field_posttranslation_meta_keywords.py b/djangocms_blog/south_migrations/0005_auto__add_field_posttranslation_meta_keywords.py similarity index 100% rename from djangocms_blog/migrations/0005_auto__add_field_posttranslation_meta_keywords.py rename to djangocms_blog/south_migrations/0005_auto__add_field_posttranslation_meta_keywords.py diff --git a/djangocms_blog/migrations/0006_auto__add_field_post_enable_comments.py b/djangocms_blog/south_migrations/0006_auto__add_field_post_enable_comments.py similarity index 100% rename from djangocms_blog/migrations/0006_auto__add_field_post_enable_comments.py rename to djangocms_blog/south_migrations/0006_auto__add_field_post_enable_comments.py diff --git a/djangocms_blog/migrations/0007_auto__add_field_posttranslation_post_text.py b/djangocms_blog/south_migrations/0007_auto__add_field_posttranslation_post_text.py similarity index 100% rename from djangocms_blog/migrations/0007_auto__add_field_posttranslation_post_text.py rename to djangocms_blog/south_migrations/0007_auto__add_field_posttranslation_post_text.py diff --git a/djangocms_blog/migrations/0008_auto__add_field_posttranslation_meta_title.py b/djangocms_blog/south_migrations/0008_auto__add_field_posttranslation_meta_title.py similarity index 100% rename from djangocms_blog/migrations/0008_auto__add_field_posttranslation_meta_title.py rename to djangocms_blog/south_migrations/0008_auto__add_field_posttranslation_meta_title.py diff --git a/djangocms_blog/migrations/0009_auto.py b/djangocms_blog/south_migrations/0009_auto.py similarity index 100% rename from djangocms_blog/migrations/0009_auto.py rename to djangocms_blog/south_migrations/0009_auto.py diff --git a/djangocms_blog/south_migrations/__init__.py b/djangocms_blog/south_migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/djangocms_blog/templates/djangocms_blog/post_detail.html b/djangocms_blog/templates/djangocms_blog/post_detail.html index 11d63b0..e854608 100644 --- a/djangocms_blog/templates/djangocms_blog/post_detail.html +++ b/djangocms_blog/templates/djangocms_blog/post_detail.html @@ -42,10 +42,10 @@ {{ post.main_image.default_alt_text }} {% endif %} - {% if use_placeholer %} + {% if use_placeholder %}
{% render_placeholder post.content %}
{% else %}
{% render_model post "post_text" "post_text" %}
{% endif %} -{% endspaceless %}{% endblock content_blog %} \ No newline at end of file +{% endspaceless %}{% endblock content_blog %} diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index 860a753..858b346 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -50,7 +50,7 @@ class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView): def get_context_data(self, **kwargs): context = super(PostDetailView, self).get_context_data(**kwargs) context['meta'] = self.get_object().as_meta() - context['use_placeholer'] = get_setting('USE_PLACEHOLDER') + context['use_placeholder'] = get_setting('USE_PLACEHOLDER') setattr(self.request, BLOG_CURRENT_POST_IDENTIFIER, self.get_object()) return context diff --git a/requirements-test.txt b/requirements-test.txt index 5b69acc..33852a6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -5,5 +5,5 @@ mock>=1.0.1 nose>=1.3.0 django-nose>=1.2 flake8 -djangocms-helper>=0.4 -tox>=1.8 \ No newline at end of file +https://github.com/nephila/djangocms-helper/archive/django_17.zip +tox>=1.8 diff --git a/tox.ini b/tox.ini index d80a8d6..3a8ea73 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = {py26,py27}-django{15,16} +envlist = {py26,py27}-django{15,16},{py27}-django{17} [testenv] basepython = @@ -8,6 +8,7 @@ basepython = deps = django15: Django>=1.5,<1.6 django16: Django>=1.6,<1.7 + django17: Django>=1.7,<1.8 py26: unittest2 -r{toxinidir}/requirements-test.txt commands = djangocms-helper djangocms_blog test --cms --nose