From 2680eecc9f78fc3b5053c00334df33f8e9c92595 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Mon, 1 Dec 2014 22:54:35 +0100 Subject: [PATCH 01/18] Rename migrations. Create missing migration. --- djangocms_blog/migrations/0001_initial.py | 468 +++++------------- .../0002_post_sites.py | 0 .../migrations/0003_auto_20141201_2252.py | 20 + .../migrations_django/0001_initial.py | 135 ----- .../south_migrations/0001_initial.py | 342 +++++++++++++ ...on__del_unique_blogcategorytranslation_.py | 0 .../0003_rename_plugins.py | 0 ..._field_posttranslation_meta_description.py | 0 ...add_field_posttranslation_meta_keywords.py | 0 ...06_auto__add_field_post_enable_comments.py | 0 ...to__add_field_posttranslation_post_text.py | 0 ...o__add_field_posttranslation_meta_title.py | 0 .../0009_auto.py | 0 .../__init__.py | 0 14 files changed, 493 insertions(+), 472 deletions(-) rename djangocms_blog/{migrations_django => migrations}/0002_post_sites.py (100%) create mode 100644 djangocms_blog/migrations/0003_auto_20141201_2252.py delete mode 100644 djangocms_blog/migrations_django/0001_initial.py create mode 100644 djangocms_blog/south_migrations/0001_initial.py rename djangocms_blog/{migrations => south_migrations}/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py (100%) rename djangocms_blog/{migrations => south_migrations}/0003_rename_plugins.py (100%) rename djangocms_blog/{migrations => south_migrations}/0004_auto__add_field_posttranslation_meta_description.py (100%) rename djangocms_blog/{migrations => south_migrations}/0005_auto__add_field_posttranslation_meta_keywords.py (100%) rename djangocms_blog/{migrations => south_migrations}/0006_auto__add_field_post_enable_comments.py (100%) rename djangocms_blog/{migrations => south_migrations}/0007_auto__add_field_posttranslation_post_text.py (100%) rename djangocms_blog/{migrations => south_migrations}/0008_auto__add_field_posttranslation_meta_title.py (100%) rename djangocms_blog/{migrations => south_migrations}/0009_auto.py (100%) rename djangocms_blog/{migrations_django => south_migrations}/__init__.py (100%) 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_django/0002_post_sites.py b/djangocms_blog/migrations/0002_post_sites.py similarity index 100% rename from djangocms_blog/migrations_django/0002_post_sites.py rename to djangocms_blog/migrations/0002_post_sites.py 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/migrations_django/0001_initial.py b/djangocms_blog/migrations_django/0001_initial.py deleted file mode 100644 index 9bf1701..0000000 --- a/djangocms_blog/migrations_django/0001_initial.py +++ /dev/null @@ -1,135 +0,0 @@ -# -*- coding: utf-8 -*- -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 - - -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'), - ] - - 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=[(b'lt', b'Lithuanian'), (b'en', b'English')])), - ('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=[(b'lt', b'Lithuanian'), (b'en', b'English')])), - ('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/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/migrations_django/__init__.py b/djangocms_blog/south_migrations/__init__.py similarity index 100% rename from djangocms_blog/migrations_django/__init__.py rename to djangocms_blog/south_migrations/__init__.py From 44e565948280d45dd42b57bb41b7010e1950afac Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Mon, 1 Dec 2014 22:55:20 +0100 Subject: [PATCH 02/18] Update test configuration --- cms_helper.py | 7 ++++++- requirements-test.txt | 4 ++-- tox.ini | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) 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/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 From 15311ed0f34fd9b1f8305250c2073db8d3a45fa4 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Tue, 2 Dec 2014 12:47:39 +0100 Subject: [PATCH 03/18] Use any_language for get_absolute_url --- djangocms_blog/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index c4f2ac3..63cd67e 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -197,7 +197,9 @@ class Post(ModelMeta, TranslatableModel): kwargs = {'year': self.date_published.year, 'month': '%02d' % self.date_published.month, 'day': '%02d' % self.date_published.day, - 'slug': self.safe_translation_getter('slug', language_code=get_language())} + 'slug': self.safe_translation_getter('slug', + language_code=get_language(), + any_language=True)} return reverse('djangocms_blog:post-detail', kwargs=kwargs) def thumbnail_options(self): From 30ee5c0d0e08d634d903aca97ff5a9d70b44336a Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Tue, 2 Dec 2014 13:04:11 +0100 Subject: [PATCH 04/18] Update history --- HISTORY.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 46e968e..a478969 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,7 +10,9 @@ History * Configurable default author support * Refactored settings * Fix multilanguage issues -* Fix SEO fields length. +* Fix SEO fields length +* Post absolute url is generated from the title in any language if current is + not available.. 0.2.0 (2014-09-24) ++++++++++++++++++ From 663a4789b1645532045d5410ea081ce45e375750 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Sat, 15 Nov 2014 10:34:20 +0100 Subject: [PATCH 05/18] Remove djangocms-page-meta and djangocms-page-tags from Page menu in blog detail view to avoid confusion --- djangocms_blog/cms_toolbar.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/djangocms_blog/cms_toolbar.py b/djangocms_blog/cms_toolbar.py index 3e81a35..322cb8c 100644 --- a/djangocms_blog/cms_toolbar.py +++ b/djangocms_blog/cms_toolbar.py @@ -26,3 +26,23 @@ class BlogToolbar(CMSToolbar): admin_menu.add_modal_item(_('Edit Post'), reverse( 'admin:djangocms_blog_post_change', args=(current_post.pk,)), active=True) + + def post_template_populate(self): + current_post = getattr(self.request, BLOG_CURRENT_POST_IDENTIFIER, None) + if current_post and self.request.user.has_perm('djangocms_blog.change_post'): # pragma: no cover + # removing page meta menu, if present, to avoid confusion + try: # pragma: no cover + import djangocms_page_meta + menu = self.request.toolbar.get_or_create_menu('page') + pagemeta = menu.get_or_create_menu('pagemeta', 'meta') + menu.remove_item(pagemeta) + except ImportError: + pass + # removing page tags menu, if present, to avoid confusion + try: # pragma: no cover + import djangocms_page_meta + menu = self.request.toolbar.get_or_create_menu('page') + pagetags = menu.get_or_create_menu('pagetags', 'tags') + menu.remove_item(pagetags) + except ImportError: + pass From b9ef9d9be2425a98211bc386aa62f0d8a59f4754 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Tue, 2 Dec 2014 13:04:54 +0100 Subject: [PATCH 06/18] Update history --- HISTORY.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index a478969..f766d3a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,7 +12,10 @@ History * Fix multilanguage issues * Fix SEO fields length * Post absolute url is generated from the title in any language if current is - not available.. + not available +* If djangocms-page-meta and djangocms-page-tags are installed, the relevant + toolbar items are removed from the toolbar in the post detail view to avoid + confusings page meta / tags with post ones 0.2.0 (2014-09-24) ++++++++++++++++++ From 9d67ab4f692d6be4a734b8fceac1b2c06d61f93c Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Tue, 2 Dec 2014 14:51:50 +0100 Subject: [PATCH 07/18] Code cleanup --- djangocms_blog/cms_toolbar.py | 2 +- djangocms_blog/forms.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/djangocms_blog/cms_toolbar.py b/djangocms_blog/cms_toolbar.py index 322cb8c..741f174 100644 --- a/djangocms_blog/cms_toolbar.py +++ b/djangocms_blog/cms_toolbar.py @@ -40,7 +40,7 @@ class BlogToolbar(CMSToolbar): pass # removing page tags menu, if present, to avoid confusion try: # pragma: no cover - import djangocms_page_meta + import djangocms_page_tags menu = self.request.toolbar.get_or_create_menu('page') pagetags = menu.get_or_create_menu('pagetags', 'tags') menu.remove_item(pagetags) diff --git a/djangocms_blog/forms.py b/djangocms_blog/forms.py index 4661ca3..a9de9e0 100644 --- a/djangocms_blog/forms.py +++ b/djangocms_blog/forms.py @@ -32,4 +32,4 @@ class PostAdminForm(TranslatableModelForm): class Meta: model = Post - exclude = () \ No newline at end of file + exclude = () From aca3963f4d75c61a44d26db3886747110ae79efe Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Tue, 2 Dec 2014 14:52:11 +0100 Subject: [PATCH 08/18] Bump development version --- djangocms_blog/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangocms_blog/__init__.py b/djangocms_blog/__init__.py index 74cb0b3..757560d 100644 --- a/djangocms_blog/__init__.py +++ b/djangocms_blog/__init__.py @@ -2,4 +2,4 @@ # -*- coding: utf-8 -*- __author__ = 'Iacopo Spalletti' __email__ = 'i.spalletti@nephila.it' -__version__ = '0.3.0.b1' +__version__ = '0.3.0.b2' From 636461019c6ec891b627e63b9ac5c21402fbf02e Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 3 Dec 2014 19:50:58 +0100 Subject: [PATCH 09/18] Add test for hide_untranslated setting --- tests/test_views.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/test_views.py b/tests/test_views.py index bd27829..fb85bba 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -3,6 +3,8 @@ from django.contrib.auth.models import AnonymousUser from django.http import Http404 from django.utils.translation import activate from django.utils.timezone import now +from parler.tests.utils import override_parler_settings +from parler.utils.conf import add_default_language_settings from parler.utils.context import switch_language from djangocms_blog.feeds import LatestEntriesFeed, TagFeed from djangocms_blog.sitemaps import BlogSitemap @@ -58,6 +60,43 @@ class ViewTest(BaseTest): response = view_obj.render_to_response(context) self.assertContains(response, context['post_list'][0].get_absolute_url()) + def test_post_list_view_fallback(self): + page1, page2 = self.get_pages() + post1, post2 = self.get_posts() + + PARLER_FALLBACK = { + 1: ( + {'code': 'en'}, + {'code': 'it'}, + {'code': 'fr', 'hide_untranslated': True,}, + ), + 'default': { + 'fallback': 'en', + 'hide_untranslated': False, + } + } + + view_obj = PostListView() + request = self.get_page_request(page1, self.user, r'/fr/blog/', lang_code='fr', edit=True) + activate('fr') + view_obj.request = request + view_obj.kwargs = {} + view_obj.object_list = view_obj.get_queryset() + context = view_obj.get_context_data(object_list=view_obj.object_list) + self.assertEqual(view_obj.get_queryset().count(), 2) + + PARLER_FALLBACK = add_default_language_settings(PARLER_FALLBACK) + with override_parler_settings(PARLER_LANGUAGES=PARLER_FALLBACK): + + view_obj = PostListView() + request = self.get_page_request(page1, self.user, r'/fr/blog/', lang_code='fr', edit=True) + activate('fr') + view_obj.request = request + view_obj.kwargs = {} + view_obj.object_list = view_obj.get_queryset() + context = view_obj.get_context_data(object_list=view_obj.object_list) + self.assertEqual(view_obj.get_queryset().count(), 0) + def test_post_detail_view(self): page1, page2 = self.get_pages() post1, post2 = self.get_posts() From 877c0008c146d13c7f2cc079aab706fcf764502a Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 3 Dec 2014 19:51:16 +0100 Subject: [PATCH 10/18] Fix behavior in hide_untranslated --- djangocms_blog/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index e4dd77e..860a753 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -17,7 +17,7 @@ class BaseBlogView(ViewUrlMixin): def get_queryset(self): language = get_language() - queryset = self.model._default_manager.language(language_code=language) + queryset = self.model._default_manager.active_translations(language_code=language) if not self.request.toolbar or not self.request.toolbar.edit_mode: queryset = queryset.published() return queryset.on_site() From 3bbe66d08700e9f2edf347ff76b93fcfdc6a374d Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 3 Dec 2014 19:54:16 +0100 Subject: [PATCH 11/18] Bump required django-parler version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1a8e536..e05cff9 100755 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( ], include_package_data=True, install_requires=[ - 'django-parler>=1.1', + 'django-parler>=1.2', 'django-cms>=3.0', 'django-taggit', 'django-filer', From 18b98d42bec7c49aaedbf1fb44147546ba9ba24f Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 3 Dec 2014 19:54:35 +0100 Subject: [PATCH 12/18] Bump development version --- djangocms_blog/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/djangocms_blog/__init__.py b/djangocms_blog/__init__.py index 757560d..bb22321 100644 --- a/djangocms_blog/__init__.py +++ b/djangocms_blog/__init__.py @@ -2,4 +2,4 @@ # -*- coding: utf-8 -*- __author__ = 'Iacopo Spalletti' __email__ = 'i.spalletti@nephila.it' -__version__ = '0.3.0.b2' +__version__ = '0.3.0.b3' From 1cd52bd389817c845bfe51b9b9264a5c22e6c35e Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Fri, 5 Dec 2014 15:39:40 +0100 Subject: [PATCH 13/18] Fix plugins for users status / language --- tests/test_models.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index b5bf560..6eedae9 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -4,6 +4,7 @@ from cms.utils.copy_plugins import copy_plugins_to from cms.utils.plugins import downcast_plugins from copy import deepcopy from django.contrib import admin +from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sites.models import Site from django.core.urlresolvers import reverse @@ -243,13 +244,22 @@ class ModelsTest(BaseTest): post2 = self._get_post(self.data['en'][1]) post1.tags.add('tag 1') post1.save() + request = self.get_page_request('/', AnonymousUser(), r'/en/blog/', edit=False) + request_auth = self.get_page_request('/', self.user_staff, r'/en/blog/', edit=False) + request_edit = self.get_page_request('/', self.user_staff, r'/en/blog/', edit=True) plugin = add_plugin(post1.content, 'BlogLatestEntriesPlugin', language='en') tag = Tag.objects.get(slug='tag-1') plugin.tags.add(tag) - self.assertEqual(len(plugin.get_posts()), 0) + # unauthenticated users get no post + self.assertEqual(len(plugin.get_posts(request)), 0) + # staff users not in edit mode get no post + self.assertEqual(len(plugin.get_posts(request_auth)), 0) + # staff users in edit mode get the post + self.assertEqual(len(plugin.get_posts(request_edit)), 1) + post1.publish = True post1.save() - self.assertEqual(len(plugin.get_posts()), 1) + self.assertEqual(len(plugin.get_posts(request)), 1) def test_copy_plugin_latest(self): post1 = self._get_post(self.data['en'][0]) @@ -265,19 +275,20 @@ class ModelsTest(BaseTest): def test_plugin_author(self): post1 = self._get_post(self.data['en'][0]) post2 = self._get_post(self.data['en'][1]) + request = self.get_page_request('/', AnonymousUser(), r'/en/blog/', edit=False) plugin = add_plugin(post1.content, 'BlogAuthorPostsPlugin', language='en') plugin.authors.add(self.user) - self.assertEqual(len(plugin.get_posts()), 0) + self.assertEqual(len(plugin.get_posts(request)), 0) self.assertEqual(plugin.get_authors()[0].count, 0) post1.publish = True post1.save() - self.assertEqual(len(plugin.get_posts()), 1) + self.assertEqual(len(plugin.get_posts(request)), 1) self.assertEqual(plugin.get_authors()[0].count, 1) post2.publish = True post2.save() - self.assertEqual(len(plugin.get_posts()), 2) + self.assertEqual(len(plugin.get_posts(request)), 2) self.assertEqual(plugin.get_authors()[0].count, 2) def test_copy_plugin_author(self): From 37502d73da60160f15bfeb099be6f9d5a7e7cb5b Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Fri, 5 Dec 2014 15:40:24 +0100 Subject: [PATCH 14/18] Move plugin post queryset in the plugin models --- djangocms_blog/cms_plugins.py | 2 ++ djangocms_blog/models.py | 29 ++++++++++++++----- .../djangocms_blog/plugins/authors.html | 2 +- .../plugins/latest_entries.html | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/djangocms_blog/cms_plugins.py b/djangocms_blog/cms_plugins.py index 91ce5c5..34074c4 100644 --- a/djangocms_blog/cms_plugins.py +++ b/djangocms_blog/cms_plugins.py @@ -24,6 +24,7 @@ class BlogLatestEntriesPlugin(BlogPlugin): def render(self, context, instance, placeholder): context['instance'] = instance + context['posts_list'] = instance.get_posts(context['request']) context['TRUNCWORDS_COUNT'] = get_setting('POSTS_LIST_TRUNCWORDS_COUNT') return context @@ -38,6 +39,7 @@ class BlogAuthorPostsPlugin(BlogPlugin): def render(self, context, instance, placeholder): context['instance'] = instance + context['authors_list'] = instance.get_authors() return context diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 63cd67e..78d957f 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -219,7 +219,23 @@ class Post(ModelMeta, TranslatableModel): @python_2_unicode_compatible -class LatestPostsPlugin(CMSPlugin): +class BasePostPlugin(CMSPlugin): + + class Meta: + abstract = True + + def post_queryset(self, request): + language = get_language() + posts = Post._default_manager.active_translations(language_code=language) + if not request.toolbar or not request.toolbar.edit_mode: + posts = posts.published() + return posts + + def __str__(self): + return unicode(self.latest_posts) + + +class LatestPostsPlugin(BasePostPlugin): latest_posts = models.IntegerField(_(u'Articles'), default=get_setting('LATEST_POSTS'), help_text=_('The number of latests articles to be displayed.')) @@ -234,16 +250,15 @@ class LatestPostsPlugin(CMSPlugin): def copy_relations(self, oldinstance): self.tags = oldinstance.tags.all() - def get_posts(self): - posts = Post.objects.published() + def get_posts(self, request): + posts = self.post_queryset(request) tags = list(self.tags.all()) if tags: posts = posts.filter(tags__in=tags) return posts[:self.latest_posts] -@python_2_unicode_compatible -class AuthorEntriesPlugin(CMSPlugin): +class AuthorEntriesPlugin(BasePostPlugin): authors = models.ManyToManyField( dj_settings.AUTH_USER_MODEL, verbose_name=_('Authors'), limit_choices_to={'djangocms_blog_post_author__publish': True} @@ -259,8 +274,8 @@ class AuthorEntriesPlugin(CMSPlugin): def copy_relations(self, oldinstance): self.authors = oldinstance.authors.all() - def get_posts(self): - posts = (Post.objects.published().filter(author__in=self.authors.all())) + def get_posts(self, request): + posts = self.post_queryset(request) return posts[:self.latest_posts] def get_authors(self): diff --git a/djangocms_blog/templates/djangocms_blog/plugins/authors.html b/djangocms_blog/templates/djangocms_blog/plugins/authors.html index 759f494..6c9aa66 100644 --- a/djangocms_blog/templates/djangocms_blog/plugins/authors.html +++ b/djangocms_blog/templates/djangocms_blog/plugins/authors.html @@ -2,7 +2,7 @@

{% trans "Authors" %}