diff --git a/.travis.yml b/.travis.yml index 56c926b..ebadd2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,6 @@ matrix: env: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1 allow_failures: - - python: 2.7 - env: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1 - python: 3.3 env: DJANGO='django>=1.5,<1.6' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1 - python: 3.3 @@ -43,4 +41,4 @@ matrix: - python: 3.4 env: DJANGO='django>=1.6,<1.7' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1 - python: 3.4 - env: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1 \ No newline at end of file + env: DJANGO='django>=1.7,<1.8' NOSE_COVER_PACKAGE="djangocms_blog" NOSE_WITH_COVERAGE=1 diff --git a/HISTORY.rst b/HISTORY.rst index 46e968e..718f4ca 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,7 +10,14 @@ 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 +* 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 +* Plugin API changed to filter out posts according to the request. +* Django 1.7 support 0.2.0 (2014-09-24) ++++++++++++++++++ diff --git a/README.rst b/README.rst index 815b35b..caf8c7b 100644 --- a/README.rst +++ b/README.rst @@ -30,6 +30,7 @@ Supported Django versions: * Django 1.5 * Django 1.6 +* Django 1.7 Supported django CMS versions: @@ -40,6 +41,18 @@ Supported django CMS versions: defaults for search engines. Existing data will not be affected, but widgets that enforce the length for new data is now being used. +.. warning:: Starting from 0.3 BlogLatestEntriesPlugin and BlogAuthorPostsPlugin + the plugin API has changed: ``BlogLatestEntriesPlugin.get_posts``, + ``BlogAuthorPostsPlugin.get_authors`` requires the ``request`` + argument. Templates has been changed to use a context variable + instead. Please update your plugin templates accordingly. + +.. warning:: To ease migration to version 0.3, djangocms-blog depends on south + even on Django 1.7; while this is unnecessary for Dajngo 1.7, it + makes transition to version 0.3 painless. Hard dependency will be + removed in 0.5. + + Quickstart ---------- 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/__init__.py b/djangocms_blog/__init__.py index 74cb0b3..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.b1' +__version__ = '0.3.0.b3' 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/cms_toolbar.py b/djangocms_blog/cms_toolbar.py index 3e81a35..741f174 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_tags + menu = self.request.toolbar.get_or_create_menu('page') + pagetags = menu.get_or_create_menu('pagetags', 'tags') + menu.remove_item(pagetags) + except ImportError: + pass 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 = () 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/models.py b/djangocms_blog/models.py index c4f2ac3..78d957f 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): @@ -217,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.')) @@ -232,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} @@ -257,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/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 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 @@