From 3b91b7e29a12714f20670e58b5d12de7dde40a53 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Fri, 29 Aug 2014 06:03:17 +0200 Subject: [PATCH 1/9] Remove runtests.py --- runtests.py | 138 ---------------------------------------------------- 1 file changed, 138 deletions(-) delete mode 100644 runtests.py diff --git a/runtests.py b/runtests.py deleted file mode 100644 index 4ab27b3..0000000 --- a/runtests.py +++ /dev/null @@ -1,138 +0,0 @@ -from optparse import OptionParser -import sys -from tempfile import mkdtemp -gettext = lambda s: s - -try: - from django.conf import settings - - settings.configure( - DEBUG=True, - THUMBNAIL_DEBUG=True, - TEMPLATE_DEBUG=True, - USE_TZ=True, - DATABASES={ - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - } - }, - TEMPLATE_CONTEXT_PROCESSORS=[ - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.i18n', - 'django.core.context_processors.debug', - 'django.core.context_processors.request', - 'django.core.context_processors.media', - 'django.core.context_processors.csrf', - 'cms.context_processors.cms_settings', - 'sekizai.context_processors.sekizai', - 'django.core.context_processors.static', - ], - MIDDLEWARE_CLASSES=[ - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.middleware.doc.XViewMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.cache.FetchFromCacheMiddleware', - 'cms.middleware.language.LanguageCookieMiddleware', - 'cms.middleware.user.CurrentUserMiddleware', - 'cms.middleware.page.CurrentPageMiddleware', - 'cms.middleware.toolbar.ToolbarMiddleware', - ], - ROOT_URLCONF='tests.test_utils.urls', - INSTALLED_APPS=[ - 'django.contrib.auth', - 'django.contrib.admin', - 'django.contrib.contenttypes', - 'django.contrib.sites', - 'cms', - 'django_nose', - 'menus', - 'mptt', - 'sekizai', - 'filer', - 'parler', - 'taggit', - 'meta', - 'meta_mixin', - 'easy_thumbnails', - 'djangocms_text_ckeditor', - 'cmsplugin_filer_image', - 'django_select2', - 'taggit_autosuggest', - 'djangocms_blog', - 'tests.test_utils', - ], - LANGUAGE_CODE='en', - LANGUAGES=( - ('en', gettext('English')), - ('fr', gettext('French')), - ('it', gettext('Italiano')), - ), - CMS_LANGUAGES={ - 1: [ - { - 'code': 'en', - 'name': gettext('English'), - 'public': True, - }, - { - 'code': 'it', - 'name': gettext('Italiano'), - 'public': True, - }, - { - 'code': 'fr', - 'name': gettext('French'), - 'public': True, - }, - ], - 'default': { - 'hide_untranslated': False, - }, - }, - CMS_TEMPLATES=( - ('page.html', 'page'), - ), - SITE_ID=1, - NOSE_ARGS=['-s'], - META_SITE_PROTOCOL='http', - META_SITE_DOMAIN='example.com', - META_USE_OG_PROPERTIES=True, - META_USE_TWITTER_PROPERTIES=True, - META_USE_GOOGLEPLUS_PROPERTIES=True, - THUMBNAIL_PROCESSORS=( - 'easy_thumbnails.processors.colorspace', - 'easy_thumbnails.processors.autocrop', - 'filer.thumbnail_processors.scale_and_crop_with_subject_location', - 'easy_thumbnails.processors.filters', - ), - FILE_UPLOAD_TEMP_DIR=mkdtemp() - ) - - from django_nose import NoseTestSuiteRunner -except ImportError as e: - print(e) - raise ImportError('To fix this error, run: pip install -r requirements-test.txt') - - -def run_tests(*test_args): - if not test_args: - test_args = ['tests'] - - # Run tests - test_runner = NoseTestSuiteRunner(verbosity=1) - - failures = test_runner.run_tests(test_args) - - if failures: - sys.exit(failures) - - -if __name__ == '__main__': - parser = OptionParser() - (options, args) = parser.parse_args() - run_tests(*args) From ec90102bce6895186cd984691e0432f04048ba2b Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Wed, 3 Sep 2014 08:45:25 +0200 Subject: [PATCH 2/9] Fix parler configuration in tests --- cms_helper.py | 127 ++++++++++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/cms_helper.py b/cms_helper.py index 143403e..c291462 100644 --- a/cms_helper.py +++ b/cms_helper.py @@ -1,65 +1,78 @@ # -*- coding: utf-8 -*- +import sys from tempfile import mkdtemp gettext = lambda s: s HELPER_SETTINGS = { - 'NOSE_ARGS':[ - '-s', - ], - 'ROOT_URLCONF':'tests.test_utils.urls', - 'INSTALLED_APPS':[ - 'django_nose', - 'filer', - 'parler', - 'taggit', - 'meta', - 'meta_mixin', - 'easy_thumbnails', - 'djangocms_text_ckeditor', - 'cmsplugin_filer_image', - 'django_select2', - 'taggit_autosuggest', - 'djangocms_blog', - ], - 'LANGUAGE_CODE':'en', - 'LANGUAGES':( - ('en', gettext('English')), - ('fr', gettext('French')), - ('it', gettext('Italiano')), - ), - 'CMS_LANGUAGES':{ - 1: [ - { - 'code': 'en', - 'name': gettext('English'), - 'public': True, - }, - { - 'code': 'it', - 'name': gettext('Italiano'), - 'public': True, - }, - { - 'code': 'fr', - 'name': gettext('French'), - 'public': True, - }, - ], - 'default': { - 'hide_untranslated': False, + 'NOSE_ARGS': [ + '-s', + ], + 'ROOT_URLCONF': 'tests.test_utils.urls', + 'INSTALLED_APPS': [ + 'admin_enhancer', + 'filer', + 'parler', + 'taggit', + 'meta', + 'meta_mixin', + 'easy_thumbnails', + 'djangocms_text_ckeditor', + 'cmsplugin_filer_image', + 'django_select2', + 'taggit_autosuggest', + 'djangocms_blog', + ], + 'LANGUAGE_CODE': 'en', + 'LANGUAGES': ( + ('en', gettext('English')), + ('fr', gettext('French')), + ('it', gettext('Italiano')), + ), + 'CMS_LANGUAGES': { + 1: [ + { + 'code': 'en', + 'name': gettext('English'), + 'public': True, }, + { + 'code': 'it', + 'name': gettext('Italiano'), + 'public': True, + }, + { + 'code': 'fr', + 'name': gettext('French'), + 'public': True, + }, + ], + 'default': { + 'hide_untranslated': False, }, - 'META_SITE_PROTOCOL':'http', - 'META_SITE_DOMAIN':'example.com', - 'META_USE_OG_PROPERTIES':True, - 'META_USE_TWITTER_PROPERTIES':True, - 'META_USE_GOOGLEPLUS_PROPERTIES':True, - 'THUMBNAIL_PROCESSORS':( - 'easy_thumbnails.processors.colorspace', - 'easy_thumbnails.processors.autocrop', - 'filer.thumbnail_processors.scale_and_crop_with_subject_location', - 'easy_thumbnails.processors.filters', + }, + 'PARLER_LANGUAGES': { + 1: ( + {'code': 'en'}, + {'code': 'it'}, + {'code': 'fr'}, ), - 'FILE_UPLOAD_TEMP_DIR':mkdtemp() - -} \ No newline at end of file + 'default': { + 'fallback': 'en', + 'hide_untranslated': False, + } + }, + 'META_SITE_PROTOCOL': 'http', + 'META_SITE_DOMAIN': 'example.com', + 'META_USE_OG_PROPERTIES': True, + 'META_USE_TWITTER_PROPERTIES': True, + 'META_USE_GOOGLEPLUS_PROPERTIES': True, + 'THUMBNAIL_PROCESSORS': ( + 'easy_thumbnails.processors.colorspace', + 'easy_thumbnails.processors.autocrop', + 'filer.thumbnail_processors.scale_and_crop_with_subject_location', + 'easy_thumbnails.processors.filters', + ), + 'FILE_UPLOAD_TEMP_DIR': mkdtemp(), +} +if 'test' in sys.argv: + HELPER_SETTINGS['INSTALLED_APPS'].append('django_nose') \ No newline at end of file From 3fad9265593fd7b02dad43d412e2da1ceecf2c7c Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Thu, 4 Sep 2014 09:14:12 +0200 Subject: [PATCH 3/9] Update migrations for custom user models --- djangocms_blog/migrations/0001_initial.py | 26 ++++++++++++------- ...on__del_unique_blogcategorytranslation_.py | 15 +++++------ .../migrations/0003_rename_plugins.py | 19 +++++++------- ..._field_posttranslation_meta_description.py | 11 ++++---- ...add_field_posttranslation_meta_keywords.py | 11 ++++---- ...06_auto__add_field_post_enable_comments.py | 11 ++++---- ...to__add_field_posttranslation_post_text.py | 11 ++++---- 7 files changed, 52 insertions(+), 52 deletions(-) diff --git a/djangocms_blog/migrations/0001_initial.py b/djangocms_blog/migrations/0001_initial.py index 14a6b9a..b3087dc 100644 --- a/djangocms_blog/migrations/0001_initial.py +++ b/djangocms_blog/migrations/0001_initial.py @@ -1,10 +1,16 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +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): @@ -53,10 +59,10 @@ class Migration(SchemaMigration): # 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['auth.User'])), + ('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=datetime.datetime.now)), + ('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)), @@ -112,7 +118,7 @@ class Migration(SchemaMigration): 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[u'auth.user'], null=False)) + ('user', models.ForeignKey(orm[user_orm_label], null=False)) )) db.create_unique(m2m_table_name, ['authorentriesplugin_id', 'user_id']) @@ -175,8 +181,8 @@ class Migration(SchemaMigration): u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) }, - u'auth.user': { - 'Meta': {'object_name': 'User'}, + 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'}), @@ -230,7 +236,7 @@ class Migration(SchemaMigration): }, 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['auth.User']", 'symmetrical': 'False'}), + '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'}) }, @@ -258,7 +264,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), + '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'}), @@ -292,7 +298,7 @@ class Migration(SchemaMigration): '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['auth.User']"}), + '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'}) @@ -305,7 +311,7 @@ class Migration(SchemaMigration): 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['auth.User']"}), + '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'}), diff --git a/djangocms_blog/migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py b/djangocms_blog/migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py index 2a3bf30..0f6a554 100644 --- a/djangocms_blog/migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py +++ b/djangocms_blog/migrations/0002_auto__del_blogcategorytranslation__del_unique_blogcategorytranslation_.py @@ -1,22 +1,21 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +from django.conf import settings as dj_settings from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Post.author' - db.alter_column(u'djangocms_blog_post', 'author_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) + db.alter_column(u'djangocms_blog_post', 'author_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm[dj_settings.AUTH_USER_MODEL], null=True)) def backwards(self, orm): raise RuntimeError("Cannot reverse this migration. 'Post.author' and its values cannot be restored.") # The following code is provided here to aid in writing a correct migration # Changing field 'Post.author' - db.alter_column(u'djangocms_blog_post', 'author_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])) + db.alter_column(u'djangocms_blog_post', 'author_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm[dj_settings.AUTH_USER_MODEL])) models = { u'auth.group': { @@ -87,7 +86,7 @@ class Migration(SchemaMigration): }, 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['auth.User']", 'symmetrical': 'False'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, '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'}) }, @@ -115,7 +114,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, 'null': 'True', 'blank': 'True'}), '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'}), @@ -149,7 +148,7 @@ class Migration(SchemaMigration): '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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}) @@ -162,7 +161,7 @@ class Migration(SchemaMigration): 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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}), diff --git a/djangocms_blog/migrations/0003_rename_plugins.py b/djangocms_blog/migrations/0003_rename_plugins.py index cc2e53e..2c62b0d 100644 --- a/djangocms_blog/migrations/0003_rename_plugins.py +++ b/djangocms_blog/migrations/0003_rename_plugins.py @@ -1,20 +1,19 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +from django.conf import settings as dj_settings from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): def forwards(self, orm): - db.rename_table(u'cmsplugin_latestpostsplugin', u'djangocms_blog_latestpostsplugin') - db.rename_table(u'cmsplugin_authorentriesplugin', u'djangocms_blog_authorentriesplugin') + db.rename_table(u'cmsplugin_latestpostsplugin', u'djangocms_blog_latestpostsplugin') + db.rename_table(u'cmsplugin_authorentriesplugin', u'djangocms_blog_authorentriesplugin') def backwards(self, orm): - db.rename_table(u'djangocms_blog_latestpostsplugin', u'cmsplugin_latestpostsplugin') - db.rename_table(u'djangocms_blog_authorentriesplugin', u'cmsplugin_authorentriesplugin') + db.rename_table(u'djangocms_blog_latestpostsplugin', u'cmsplugin_latestpostsplugin') + db.rename_table(u'djangocms_blog_authorentriesplugin', u'cmsplugin_authorentriesplugin') models = { @@ -86,7 +85,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.authorentriesplugin': { 'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, - 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, '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'}) }, @@ -114,7 +113,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, 'null': 'True', 'blank': 'True'}), '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'}), @@ -148,7 +147,7 @@ class Migration(SchemaMigration): '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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}) @@ -161,7 +160,7 @@ class Migration(SchemaMigration): 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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}), diff --git a/djangocms_blog/migrations/0004_auto__add_field_posttranslation_meta_description.py b/djangocms_blog/migrations/0004_auto__add_field_posttranslation_meta_description.py index 73e37b5..81518b1 100644 --- a/djangocms_blog/migrations/0004_auto__add_field_posttranslation_meta_description.py +++ b/djangocms_blog/migrations/0004_auto__add_field_posttranslation_meta_description.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +from django.conf import settings as dj_settings from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): @@ -88,7 +87,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.authorentriesplugin': { 'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, - 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, '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'}) }, @@ -116,7 +115,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, 'null': 'True', 'blank': 'True'}), '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'}), @@ -151,7 +150,7 @@ class Migration(SchemaMigration): '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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}) @@ -164,7 +163,7 @@ class Migration(SchemaMigration): 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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}), diff --git a/djangocms_blog/migrations/0005_auto__add_field_posttranslation_meta_keywords.py b/djangocms_blog/migrations/0005_auto__add_field_posttranslation_meta_keywords.py index c5b538b..5af45bf 100644 --- a/djangocms_blog/migrations/0005_auto__add_field_posttranslation_meta_keywords.py +++ b/djangocms_blog/migrations/0005_auto__add_field_posttranslation_meta_keywords.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +from django.conf import settings as dj_settings from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): @@ -88,7 +87,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.authorentriesplugin': { 'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, - 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, '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'}) }, @@ -116,7 +115,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, 'null': 'True', 'blank': 'True'}), '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'}), @@ -152,7 +151,7 @@ class Migration(SchemaMigration): '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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}) @@ -165,7 +164,7 @@ class Migration(SchemaMigration): 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['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}), diff --git a/djangocms_blog/migrations/0006_auto__add_field_post_enable_comments.py b/djangocms_blog/migrations/0006_auto__add_field_post_enable_comments.py index d31b001..228f717 100644 --- a/djangocms_blog/migrations/0006_auto__add_field_post_enable_comments.py +++ b/djangocms_blog/migrations/0006_auto__add_field_post_enable_comments.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +from django.conf import settings as dj_settings from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): @@ -88,7 +87,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.authorentriesplugin': { 'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, - 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, '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'}) }, @@ -116,7 +115,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'djangocms_blog_post_author'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'djangocms_blog_post_author'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}), @@ -153,7 +152,7 @@ class Migration(SchemaMigration): 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'default': "u''", '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': "u'owned_files'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'owned_files'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'polymorphic_filer.file_set'", 'null': 'True', 'to': u"orm['contenttypes.ContentType']"}), 'sha1': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '40', 'blank': 'True'}), 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) @@ -166,7 +165,7 @@ class Migration(SchemaMigration): 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': "u'filer_owned_folders'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'children'", 'null': 'True', 'to': u"orm['filer.Folder']"}), u'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), diff --git a/djangocms_blog/migrations/0007_auto__add_field_posttranslation_post_text.py b/djangocms_blog/migrations/0007_auto__add_field_posttranslation_post_text.py index 6979048..f1da468 100644 --- a/djangocms_blog/migrations/0007_auto__add_field_posttranslation_post_text.py +++ b/djangocms_blog/migrations/0007_auto__add_field_posttranslation_post_text.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime +from django.conf import settings as dj_settings from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): @@ -88,7 +87,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.authorentriesplugin': { 'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, - 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False'}), + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL, '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'}) }, @@ -116,7 +115,7 @@ class Migration(SchemaMigration): }, u'djangocms_blog.post': { 'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': 'Post'}, - 'author': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'djangocms_blog_post_author'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'djangocms_blog_post_author'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), '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'}), @@ -154,7 +153,7 @@ class Migration(SchemaMigration): 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'default': "u''", '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': "u'owned_files'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'owned_files'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), 'polymorphic_ctype': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'polymorphic_filer.file_set'", 'null': 'True', 'to': u"orm['contenttypes.ContentType']"}), 'sha1': ('django.db.models.fields.CharField', [], {'default': "u''", 'max_length': '40', 'blank': 'True'}), 'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) @@ -167,7 +166,7 @@ class Migration(SchemaMigration): 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': "u'filer_owned_folders'", 'null': 'True', 'to': u"orm['auth.User']"}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'filer_owned_folders'", 'null': 'True', 'to': u"orm['%s']" % dj_settings.AUTH_USER_MODEL}), 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "u'children'", 'null': 'True', 'to': u"orm['filer.Folder']"}), u'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), From 3a03cb71fe4f59940a3fc445ce0ad63339f162e7 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Thu, 4 Sep 2014 09:16:56 +0200 Subject: [PATCH 4/9] Add support for custom user models --- djangocms_blog/models.py | 18 +++++++++++------- .../djangocms_blog/includes/blog_item.html | 2 +- .../djangocms_blog/plugins/authors.html | 2 +- .../templates/djangocms_blog/post_detail.html | 2 +- djangocms_blog/views.py | 13 ++++++++----- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index f052c45..1ae7ed8 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from cms.models import PlaceholderField, CMSPlugin from cmsplugin_filer_image.models import ThumbnailOption -from django.contrib.auth.models import User +from django.conf import settings as dj_settings from django.core.urlresolvers import reverse from django.db import models from django.utils import timezone @@ -62,7 +62,8 @@ class Post(ModelMeta, TranslatableModel): """ Blog post """ - author = models.ForeignKey(User, verbose_name=_('Author'), null=True, blank=True, + author = models.ForeignKey(dj_settings.AUTH_USER_MODEL, + verbose_name=_('Author'), null=True, blank=True, related_name='djangocms_blog_post_author') date_created = models.DateTimeField(auto_now_add=True) @@ -217,11 +218,14 @@ class LatestPostsPlugin(CMSPlugin): class AuthorEntriesPlugin(CMSPlugin): - authors = models.ManyToManyField(User, verbose_name=_('Authors'), - limit_choices_to={'djangocms_blog_post_author__publish': True} - ) - latest_posts = models.IntegerField(_(u'Articles'), default=settings.BLOG_LATEST_POSTS, - help_text=_('The number of author articles to be displayed.')) + authors = models.ManyToManyField( + dj_settings.AUTH_USER_MODEL, verbose_name=_('Authors'), + limit_choices_to={'djangocms_blog_post_author__publish': True} + ) + latest_posts = models.IntegerField( + _(u'Articles'), default=settings.BLOG_LATEST_POSTS, + help_text=_('The number of author articles to be displayed.') + ) def __unicode__(self): return u"%s latest articles by author" % self.latest_posts diff --git a/djangocms_blog/templates/djangocms_blog/includes/blog_item.html b/djangocms_blog/templates/djangocms_blog/includes/blog_item.html index f7884d0..f5c2022 100644 --- a/djangocms_blog/templates/djangocms_blog/includes/blog_item.html +++ b/djangocms_blog/templates/djangocms_blog/includes/blog_item.html @@ -7,7 +7,7 @@ {% block blog_meta %}
  • - {% trans "by" %} {{ post.author.get_full_name }} + {% trans "by" %} {{ post.author.get_full_name }}
  • {{ post.date_published|date:"M d, Y" }} diff --git a/djangocms_blog/templates/djangocms_blog/plugins/authors.html b/djangocms_blog/templates/djangocms_blog/plugins/authors.html index 9669eb6..759f494 100644 --- a/djangocms_blog/templates/djangocms_blog/plugins/authors.html +++ b/djangocms_blog/templates/djangocms_blog/plugins/authors.html @@ -3,7 +3,7 @@

    {% trans "Authors" %}

      {% for author in instance.get_authors %} -
    • +
    • {{ author.get_full_name }} ( {% if author.count > 0 %} diff --git a/djangocms_blog/templates/djangocms_blog/post_detail.html b/djangocms_blog/templates/djangocms_blog/post_detail.html index 7d151f3..e283417 100644 --- a/djangocms_blog/templates/djangocms_blog/post_detail.html +++ b/djangocms_blog/templates/djangocms_blog/post_detail.html @@ -13,7 +13,7 @@ {% block blog_meta %}
      • - {% trans "by" %} {{ post.author.get_full_name }} + {% trans "by" %} {{ post.author.get_full_name }}
      • {{ post.date_published|date:"M d, Y" }} diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index b8dd8e7..f354a21 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -from django.utils.translation import get_language -from django.utils.timezone import now -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model +from django.conf import settings as dj_settings from django.core.urlresolvers import resolve +from django.utils.timezone import now +from django.utils.translation import get_language from django.views.generic import ListView, DetailView from parler.views import ViewUrlMixin, TranslatableSlugMixin @@ -11,6 +12,8 @@ from .models import Post, BlogCategory, BLOG_CURRENT_POST_IDENTIFIER from .settings import (BLOG_PAGINATION, BLOG_POSTS_LIST_TRUNCWORDS_COUNT, BLOG_USE_PLACEHOLDER) +User = get_user_model() + class BaseBlogView(ViewUrlMixin): @@ -107,11 +110,11 @@ class AuthorEntriesView(BaseBlogView, ListView): def get_queryset(self): qs = super(AuthorEntriesView, self).get_queryset() if 'username' in self.kwargs: - qs = qs.filter(author__username=self.kwargs['username']) + qs = qs.filter(**{'author__%s' % User.USERNAME_FIELD: self.kwargs['username']}) return qs def get_context_data(self, **kwargs): - kwargs['author'] = User.objects.get(username=self.kwargs.get('username')) + kwargs['author'] = User.objects.get(**{User.USERNAME_FIELD: self.kwargs.get('username')}) return super(AuthorEntriesView, self).get_context_data(**kwargs) From 96bfefadea2b2ff08bc5b89c9fa7f72084583bb5 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Thu, 4 Sep 2014 09:17:03 +0200 Subject: [PATCH 5/9] Update tests --- tests/__init__.py | 13 ++++++++----- tests/test_models.py | 5 +++++ tests/test_plugins.py | 2 +- tests/test_utils/urls.py | 1 + tests/test_views.py | 3 ++- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index 330f661..7db2743 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -7,16 +7,19 @@ import os from cms.utils.i18n import get_language_list from cmsplugin_filer_image.models import ThumbnailOption from django.conf import settings -from django.contrib.auth.models import User +from django.contrib.auth import get_user_model from django.core.files import File as DjangoFile from django.http import SimpleCookie from django.test import TestCase, RequestFactory from django.utils.translation import activate from filer.models import File, Image -from PIL import Image as PilImage, ImageChops, ImageDraw +from PIL import Image as PilImage, ImageDraw from six import StringIO from djangocms_blog.models import BlogCategory, Post +from djangocms_helper.utils import create_user + +User = get_user_model() class BaseTest(TestCase): @@ -52,9 +55,9 @@ class BaseTest(TestCase): @classmethod def setUpClass(cls): cls.request_factory = RequestFactory() - cls.user = User.objects.create(username='admin', is_staff=True, is_superuser=True) - cls.user_staff = User.objects.create(username='staff', is_staff=True) - cls.user_normal = User.objects.create(username='normal') + cls.user = create_user('admin', 'admin@admin.com', 'admin', is_staff=True, is_superuser=True) + cls.user_staff = create_user('staff', 'staff@admin.com', 'staff', is_staff=True) + cls.user_normal = create_user('normal', 'normal@admin.com', 'normal') def setUp(self): activate('en') diff --git a/tests/test_models.py b/tests/test_models.py index e3d2aa5..a5242de 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -2,6 +2,7 @@ from cms.api import add_plugin from cms.utils.copy_plugins import copy_plugins_to from cms.utils.plugins import downcast_plugins +from django.contrib.sites.models import Site from django.core.urlresolvers import reverse from django.utils.timezone import now import parler @@ -115,8 +116,12 @@ class ModelsTest(BaseTest): # No fallback parler.appsettings.PARLER_LANGUAGES['default']['hide_untranslated'] = True + for index, lang in enumerate(parler.appsettings.PARLER_LANGUAGES[Site.objects.get_current().pk]): + parler.appsettings.PARLER_LANGUAGES[Site.objects.get_current().pk][index]['hide_untranslated'] = True self.assertEqual(len(Post.objects.filter_by_language('it')), 1) parler.appsettings.PARLER_LANGUAGES['default']['hide_untranslated'] = False + for index, lang in enumerate(parler.appsettings.PARLER_LANGUAGES[Site.objects.get_current().pk]): + parler.appsettings.PARLER_LANGUAGES[Site.objects.get_current().pk][index]['hide_untranslated'] = False def test_tag_cloud(self): post1 = self._get_post(self.data['en'][0]) diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 6e3f77d..ec36c4b 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -45,7 +45,7 @@ class PluginTest(BaseTest): request = self.get_page_request(page1, self.user, r'/en/blog/', lang_code='en', edit=True) context = RequestContext(request, {}) rendered = plugin.render_plugin(context, ph) - self.assertTrue(rendered.find(reverse('djangocms_blog:posts-author', kwargs={'username': self.user.username})) > -1) + self.assertTrue(rendered.find(reverse('djangocms_blog:posts-author', kwargs={'username': self.user.get_username()})) > -1) self.assertTrue(rendered.find('2 articles') > -1) def test_plugin_tags(self): diff --git a/tests/test_utils/urls.py b/tests/test_utils/urls.py index e720a3f..ea19448 100644 --- a/tests/test_utils/urls.py +++ b/tests/test_utils/urls.py @@ -16,6 +16,7 @@ urlpatterns = patterns('', url(r'^media/cms/(?P.*)$', 'django.views.static.serve', {'document_root': get_cms_setting('MEDIA_ROOT'), 'show_indexes': True}), url(r'^jsi18n/(?P\S+?)/$', 'django.views.i18n.javascript_catalog'), + url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')), ) urlpatterns += staticfiles_urlpatterns() diff --git a/tests/test_views.py b/tests/test_views.py index 8896dc4..9cbec46 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -3,6 +3,7 @@ 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 djangocms_blog.models import Post from djangocms_blog.feeds import LatestEntriesFeed, TagFeed from djangocms_blog.sitemaps import BlogSitemap from djangocms_blog.views import (PostListView, PostDetailView, @@ -132,7 +133,7 @@ class ViewTest(BaseTest): activate('en') view_obj = AuthorEntriesView() view_obj.request = request - view_obj.kwargs = {'username': 'admin'} + view_obj.kwargs = {'username': self.user.get_username()} qs = view_obj.get_queryset() self.assertEqual(qs.count(), 2) self.assertEqual(set(qs), set([post1, post2])) From be9d09be38ffc5c21c376a3021f45e8de159b75d Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Thu, 4 Sep 2014 09:19:34 +0200 Subject: [PATCH 6/9] Code cleanup --- djangocms_blog/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index f354a21..945fcaa 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- from django.contrib.auth import get_user_model -from django.conf import settings as dj_settings from django.core.urlresolvers import resolve from django.utils.timezone import now from django.utils.translation import get_language From 132707d593f13d6ea94009e9c06120674614fa47 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Thu, 4 Sep 2014 09:19:59 +0200 Subject: [PATCH 7/9] Bump dev version. Update changelog. --- HISTORY.rst | 3 ++- djangocms_blog/__init__.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a552087..ce8eabb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,13 +7,14 @@ History ++++++++++++++++++++++ * **INCOMPATIBLE CHANGE**: view names changed! -* Synced with latest django-parler development branch +* Based on django parler 1.0 * Toolbar items contextual to the current page * Add support for canonical URLs * Add transifex support * Add social tags via django-meta-mixin * Per-post or site-wide comments enabling * Simpler TextField-based content editing for simpler blogs +* Add support for custom user models 0.1.0 (2014-03-06) diff --git a/djangocms_blog/__init__.py b/djangocms_blog/__init__.py index b074002..e75e531 100644 --- a/djangocms_blog/__init__.py +++ b/djangocms_blog/__init__.py @@ -1 +1 @@ -__version__ = '0.2c1' +__version__ = '0.2c2' From e8beed43ab7b0713259f5f8fa8fd94c4431c531a Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Fri, 5 Sep 2014 08:28:10 +0200 Subject: [PATCH 8/9] Fix quote style --- djangocms_blog/cms_app.py | 4 ++-- djangocms_blog/cms_toolbar.py | 2 +- djangocms_blog/forms.py | 2 +- djangocms_blog/managers.py | 22 ++++++++++++---------- djangocms_blog/models.py | 12 ++++++------ djangocms_blog/views.py | 16 ++++++++-------- 6 files changed, 30 insertions(+), 28 deletions(-) diff --git a/djangocms_blog/cms_app.py b/djangocms_blog/cms_app.py index c658fc0..f00c96f 100644 --- a/djangocms_blog/cms_app.py +++ b/djangocms_blog/cms_app.py @@ -5,8 +5,8 @@ from django.utils.translation import ugettext_lazy as _ class BlogApp(CMSApp): - name = _("Blog") - urls = ["djangocms_blog.urls"] + name = _('Blog') + urls = ['djangocms_blog.urls'] app_name = 'djangocms_blog' apphook_pool.register(BlogApp) diff --git a/djangocms_blog/cms_toolbar.py b/djangocms_blog/cms_toolbar.py index eae4a36..3e81a35 100644 --- a/djangocms_blog/cms_toolbar.py +++ b/djangocms_blog/cms_toolbar.py @@ -15,7 +15,7 @@ class BlogToolbar(CMSToolbar): # TODO: Readd if not self.is_current_app condition when CMS 3.0.4 is released if not self.request.user.has_perm('djangocms_blog.add_post'): return # pragma: no cover - admin_menu = self.toolbar.get_or_create_menu("djangocms_blog", _('Blog')) + admin_menu = self.toolbar.get_or_create_menu('djangocms_blog', _('Blog')) url = reverse('admin:djangocms_blog_post_changelist') admin_menu.add_modal_item(_('Post list'), url=url) url = reverse('admin:djangocms_blog_post_add') diff --git a/djangocms_blog/forms.py b/djangocms_blog/forms.py index 3a760d0..6d8310a 100644 --- a/djangocms_blog/forms.py +++ b/djangocms_blog/forms.py @@ -14,5 +14,5 @@ class LatestEntriesForm(forms.ModelForm): class Media: css = { 'all': ('%sdjangocms_blog/css/%s' % (settings.STATIC_URL, - "djangocms_blog_admin.css"),) + 'djangocms_blog_admin.css'),) } diff --git a/djangocms_blog/managers.py b/djangocms_blog/managers.py index 4d9a891..0e9fd70 100644 --- a/djangocms_blog/managers.py +++ b/djangocms_blog/managers.py @@ -48,7 +48,7 @@ class TaggedFilterItem(object): def tag_list_slug(self, other_model=None, queryset=None): queryset = self.tag_list(other_model, queryset) - return queryset.values("slug") + return queryset.values('slug') def tag_cloud(self, other_model=None, queryset=None, published=True): from taggit.models import TaggedItem @@ -70,9 +70,9 @@ class TaggedFilterItem(object): class GenericDateTaggedManager(TaggedFilterItem, TranslationManager): use_for_related_fields = True - start_date_field = "date_published" - end_date_field = "date_published_end" - publish_field = "publish" + start_date_field = 'date_published' + end_date_field = 'date_published_end' + publish_field = 'publish' def get_queryset(self, *args, **kwargs): try: @@ -84,7 +84,7 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager): queryset = self.published_future(queryset) if self.start_date_field: return queryset.filter( - **{"%s__lte" % self.start_date_field: now()}) + **{'%s__lte' % self.start_date_field: now()}) else: return queryset @@ -93,8 +93,8 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager): queryset = self.get_queryset().all() if self.end_date_field: qfilter = ( - models.Q(**{"%s__gte" % self.end_date_field: now()}) - | models.Q(**{"%s__isnull" % self.end_date_field: True}) + models.Q(**{'%s__gte' % self.end_date_field: now()}) + | models.Q(**{'%s__isnull' % self.end_date_field: True}) ) queryset = queryset.filter(qfilter) return queryset.filter(**{self.publish_field: True}) @@ -104,8 +104,8 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager): queryset = self.get_queryset().all() if self.end_date_field: qfilter = ( - models.Q(**{"%s__lte" % self.end_date_field: now()}) - | models.Q(**{"%s__isnull" % self.end_date_field: False}) + models.Q(**{'%s__lte' % self.end_date_field: now()}) + | models.Q(**{'%s__isnull' % self.end_date_field: False}) ) queryset = queryset.filter(qfilter) return queryset.filter(**{self.publish_field: True}) @@ -119,7 +119,9 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager): return self.get_queryset().active_translations(language_code=language) def get_months(self, queryset=None): - """Get months with aggregate count (how much posts is in the month). Results are ordered by date.""" + """ + Get months with aggregate count (how much posts is in the month). Results are ordered by date. + """ if queryset is None: queryset = self.get_queryset() dates = queryset.values_list(self.start_date_field, flat=True) diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 1ae7ed8..2311ac5 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -101,7 +101,7 @@ class Post(ModelMeta, TranslatableModel): post_text=HTMLField(_('Text'), default='', blank=True), meta={'unique_together': (('language_code', 'slug'),)} ) - content = PlaceholderField("post_content") + content = PlaceholderField('post_content') objects = GenericDateTaggedManager() tags = TaggableManager(blank=True, related_name='djangocms_blog_tags') @@ -134,7 +134,7 @@ class Post(ModelMeta, TranslatableModel): } def get_keywords(self): - return self.safe_translation_getter('meta_keywords').strip().split(",") + return self.safe_translation_getter('meta_keywords').strip().split(',') def get_description(self): description = self.safe_translation_getter('meta_description', any_language=True) @@ -149,7 +149,7 @@ class Post(ModelMeta, TranslatableModel): def get_tags(self): taglist = [tag.name for tag in self.tags.all()] - return ",".join(taglist) + return ','.join(taglist) def get_author(self): return self.author @@ -157,7 +157,7 @@ class Post(ModelMeta, TranslatableModel): class Meta: verbose_name = _('blog article') verbose_name_plural = _('blog articles') - ordering = ("-date_published", "-date_created") + ordering = ('-date_published', '-date_created') get_latest_by = 'date_published' def __unicode__(self): @@ -204,7 +204,7 @@ class LatestPostsPlugin(CMSPlugin): help_text=_('Show only the blog articles tagged with chosen categories.')) def __unicode__(self): - return u"%s latest articles by tag" % self.latest_posts + return u'%s latest articles by tag' % self.latest_posts def copy_relations(self, oldinstance): self.tags = oldinstance.tags.all() @@ -228,7 +228,7 @@ class AuthorEntriesPlugin(CMSPlugin): ) def __unicode__(self): - return u"%s latest articles by author" % self.latest_posts + return u'%s latest articles by author' % self.latest_posts def copy_relations(self, oldinstance): self.authors = oldinstance.authors.all() diff --git a/djangocms_blog/views.py b/djangocms_blog/views.py index 945fcaa..43207a5 100644 --- a/djangocms_blog/views.py +++ b/djangocms_blog/views.py @@ -31,7 +31,7 @@ class BaseBlogView(ViewUrlMixin): class PostListView(BaseBlogView, ListView): model = Post context_object_name = 'post_list' - template_name = "djangocms_blog/post_list.html" + template_name = 'djangocms_blog/post_list.html' paginate_by = BLOG_PAGINATION view_url_name = 'djangocms_blog:posts-latest' @@ -44,7 +44,7 @@ class PostListView(BaseBlogView, ListView): class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView): model = Post context_object_name = 'post' - template_name = "djangocms_blog/post_detail.html" + template_name = 'djangocms_blog/post_detail.html' slug_field = 'slug' view_url_name = 'djangocms_blog:post-detail' @@ -59,7 +59,7 @@ class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView): class PostArchiveView(BaseBlogView, ListView): model = Post context_object_name = 'post_list' - template_name = "djangocms_blog/post_list.html" + template_name = 'djangocms_blog/post_list.html' date_field = 'date_published' allow_empty = True allow_future = True @@ -69,9 +69,9 @@ class PostArchiveView(BaseBlogView, ListView): def get_queryset(self): qs = super(PostArchiveView, self).get_queryset() if 'month' in self.kwargs: - qs = qs.filter(**{"%s__month" % self.date_field: self.kwargs['month']}) + qs = qs.filter(**{'%s__month' % self.date_field: self.kwargs['month']}) if 'year' in self.kwargs: - qs = qs.filter(**{"%s__year" % self.date_field: self.kwargs['year']}) + qs = qs.filter(**{'%s__year' % self.date_field: self.kwargs['year']}) return qs def get_context_data(self, **kwargs): @@ -85,7 +85,7 @@ class PostArchiveView(BaseBlogView, ListView): class TaggedListView(BaseBlogView, ListView): model = Post context_object_name = 'post_list' - template_name = "djangocms_blog/post_list.html" + template_name = 'djangocms_blog/post_list.html' paginate_by = BLOG_PAGINATION view_url_name = 'djangocms_blog:posts-tagged' @@ -102,7 +102,7 @@ class TaggedListView(BaseBlogView, ListView): class AuthorEntriesView(BaseBlogView, ListView): model = Post context_object_name = 'post_list' - template_name = "djangocms_blog/post_list.html" + template_name = 'djangocms_blog/post_list.html' paginate_by = BLOG_PAGINATION view_url_name = 'djangocms_blog:posts-authors' @@ -120,7 +120,7 @@ class AuthorEntriesView(BaseBlogView, ListView): class CategoryEntriesView(BaseBlogView, ListView): model = Post context_object_name = 'post_list' - template_name = "djangocms_blog/post_list.html" + template_name = 'djangocms_blog/post_list.html' _category = None paginate_by = BLOG_PAGINATION view_url_name = 'djangocms_blog:posts-category' From 92db62ef90b0a9625c256639c515d449d7b6d344 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Mon, 1 Sep 2014 07:16:48 +0200 Subject: [PATCH 9/9] Update locales --- .../locale/ar/LC_MESSAGES/django.mo | Bin 0 -> 574 bytes .../locale/ar/LC_MESSAGES/django.po | 260 ++++++++++++++++++ .../locale/en/LC_MESSAGES/django.mo | Bin 2871 -> 2871 bytes .../locale/en/LC_MESSAGES/django.po | 38 +-- .../locale/it/LC_MESSAGES/django.mo | Bin 3211 -> 3211 bytes 5 files changed, 279 insertions(+), 19 deletions(-) create mode 100644 djangocms_blog/locale/ar/LC_MESSAGES/django.mo create mode 100644 djangocms_blog/locale/ar/LC_MESSAGES/django.po diff --git a/djangocms_blog/locale/ar/LC_MESSAGES/django.mo b/djangocms_blog/locale/ar/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..b37d139b6711afa8feded6b61b709a1ddeaab308 GIT binary patch literal 574 zcmY*V!EO^V5Dn1N9y#|g2dF^BvAtsBCH~e1A8s_ z@gXZ2LnFD=-%U6Bfp0|03iw!*)gi+wE>y~-j>;vgvX260s`0_Y=b)_BIU97icB5KN zYOU4+PNG_x23}m}90aA??RJ>Ec5|ighK*m-(1%Mj(1)3*{WpoKNM9E7+5Bu5pAT7a z>Rr|j*ZC1JSJro#2CIylLUXNR(pi3~&&g!x>)yT6k({~4uZ(L2OqM3!Z!AE?VqrH? zS#s{=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" +"X-Generator: Lokalize 1.5\n" + +#: cms_app.py:8 cms_plugins.py:32 cms_plugins.py:45 cms_plugins.py:56 +#: cms_plugins.py:67 cms_toolbar.py:18 +msgid "Blog" +msgstr "" + +#: cms_plugins.py:20 +msgid "Latest Blog Articles" +msgstr "" + +#: cms_plugins.py:33 +msgid "Author Blog Articles" +msgstr "" + +#: cms_plugins.py:46 templates/djangocms_blog/plugins/tags.html:4 +msgid "Tags" +msgstr "" + +#: cms_plugins.py:57 templates/djangocms_blog/plugins/categories.html:4 +msgid "Categories" +msgstr "" + +#: cms_plugins.py:68 templates/djangocms_blog/post_list.html:12 +#: templates/djangocms_blog/plugins/archive.html:4 +msgid "Archive" +msgstr "" + +#: cms_toolbar.py:20 +msgid "Post list" +msgstr "" + +#: cms_toolbar.py:22 +msgid "Add post" +msgstr "" + +#: cms_toolbar.py:26 +msgid "Edit Post" +msgstr "" + +#: feeds.py:16 +#, python-format +msgid "Blog articles on %(site_name)s" +msgstr "" + +#: models.py:28 +msgid "parent" +msgstr "" + +#: models.py:30 +msgid "created at" +msgstr "" + +#: models.py:31 +msgid "modified at" +msgstr "" + +#: models.py:34 +msgid "name" +msgstr "" + +#: models.py:35 models.py:95 +msgid "slug" +msgstr "" + +#: models.py:42 +msgid "blog category" +msgstr "" + +#: models.py:43 +msgid "blog categories" +msgstr "" + +#: models.py:66 +msgid "Author" +msgstr "" + +#: models.py:71 +msgid "Published Since" +msgstr "" + +#: models.py:73 +msgid "Published Until" +msgstr "" + +#: models.py:75 +msgid "Publish" +msgstr "" + +#: models.py:76 +msgid "category" +msgstr "" + +#: models.py:78 +msgid "Main image" +msgstr "" + +#: models.py:81 +msgid "Main image thumbnail" +msgstr "" + +#: models.py:85 +msgid "Main image full" +msgstr "" + +#: models.py:89 +msgid "Enable comments on post" +msgstr "" + +#: models.py:94 +msgid "Title" +msgstr "" + +#: models.py:96 +msgid "Abstract" +msgstr "" + +#: models.py:97 +msgid "Post meta description" +msgstr "" + +#: models.py:99 +msgid "Post meta keywords" +msgstr "" + +#: models.py:101 +msgid "Text" +msgstr "" + +#: models.py:158 +msgid "blog article" +msgstr "" + +#: models.py:159 +msgid "blog articles" +msgstr "" + +#: models.py:199 models.py:226 +msgid "Articles" +msgstr "" + +#: models.py:200 +msgid "The number of latests articles to be displayed." +msgstr "" + +#: models.py:202 +msgid "Show only the blog articles tagged with chosen tags." +msgstr "" + +#: models.py:204 +msgid "Show only the blog articles tagged with chosen categories." +msgstr "" + +#: models.py:222 templates/djangocms_blog/plugins/authors.html:3 +msgid "Authors" +msgstr "" + +#: models.py:227 +msgid "The number of author articles to be displayed." +msgstr "" + +#: templates/djangocms_blog/post_detail.html:16 +#: templates/djangocms_blog/includes/blog_item.html:10 +msgid "by" +msgstr "" + +#: templates/djangocms_blog/post_list.html:11 +msgid "Articles by" +msgstr "" + +#: templates/djangocms_blog/post_list.html:13 +msgid "Tag" +msgstr "" + +#: templates/djangocms_blog/post_list.html:14 +msgid "Category" +msgstr "" + +#: templates/djangocms_blog/post_list.html:21 +#: templates/djangocms_blog/plugins/archive.html:27 +#: templates/djangocms_blog/plugins/authors.html:15 +#: templates/djangocms_blog/plugins/categories.html:16 +#: templates/djangocms_blog/plugins/latest_entries.html:7 +#: templates/djangocms_blog/plugins/tags.html:16 +msgid "No article found." +msgstr "" + +#: templates/djangocms_blog/post_list.html:24 +msgid "Back" +msgstr "" + +#: templates/djangocms_blog/post_list.html:30 +msgid "previous" +msgstr "" + +#: templates/djangocms_blog/post_list.html:33 +msgid "Page" +msgstr "" + +#: templates/djangocms_blog/post_list.html:33 +msgid "of" +msgstr "" + +#: templates/djangocms_blog/post_list.html:36 +msgid "next" +msgstr "" + +#: templates/djangocms_blog/includes/blog_item.html:44 +msgid "read more" +msgstr "" + +#: templates/djangocms_blog/plugins/archive.html:18 +#: templates/djangocms_blog/plugins/authors.html:10 +#: templates/djangocms_blog/plugins/categories.html:11 +#: templates/djangocms_blog/plugins/tags.html:11 +#, python-format +msgid "1 article" +msgid_plural "%(articles)s articles" +msgstr[0] "" +msgstr[1] "" +msgstr[2] "" +msgstr[3] "" +msgstr[4] "" +msgstr[5] "" + +#: templates/djangocms_blog/plugins/archive.html:19 +#: templates/djangocms_blog/plugins/authors.html:11 +#: templates/djangocms_blog/plugins/categories.html:12 +#: templates/djangocms_blog/plugins/tags.html:12 +msgid "0 articles" +msgstr "" + +#~ msgid "blog post" +#~ msgstr "blog post" + +#~ msgid "Posts" +#~ msgstr "Posts" + +#~ msgid "Entries by" +#~ msgstr "Entries by" + +#~ msgid "No entry found." +#~ msgstr "No entry found." diff --git a/djangocms_blog/locale/en/LC_MESSAGES/django.mo b/djangocms_blog/locale/en/LC_MESSAGES/django.mo index 07df55b1f05b27c3f0799382922d64a97e62a321..16fc5c01b5f06943d543ef50b21e509c2c03a75a 100644 GIT binary patch delta 23 ecmdlkwq0z4Jv*1Bu7RO~fw`5T*=A4ncgz4#b_RX` delta 23 ecmdlkwq0z4Jv*0)u93Ndfr*uo\n" @@ -18,7 +18,7 @@ msgstr "" "X-Generator: Lokalize 1.5\n" #: cms_app.py:8 cms_plugins.py:32 cms_plugins.py:45 cms_plugins.py:56 -#: cms_plugins.py:67 cms_toolbar.py:17 +#: cms_plugins.py:67 cms_toolbar.py:18 msgid "Blog" msgstr "Blog" @@ -43,15 +43,15 @@ msgstr "Categories" msgid "Archive" msgstr "Archive" -#: cms_toolbar.py:19 +#: cms_toolbar.py:20 msgid "Post list" msgstr "Post list" -#: cms_toolbar.py:21 +#: cms_toolbar.py:22 msgid "Add post" msgstr "Add post" -#: cms_toolbar.py:25 +#: cms_toolbar.py:26 msgid "Edit Post" msgstr "" @@ -60,31 +60,31 @@ msgstr "" msgid "Blog articles on %(site_name)s" msgstr "Blog articles on %(site_name)s" -#: models.py:29 +#: models.py:28 msgid "parent" msgstr "parent" -#: models.py:31 +#: models.py:30 msgid "created at" msgstr "created at" -#: models.py:32 +#: models.py:31 msgid "modified at" msgstr "modified at" -#: models.py:35 +#: models.py:34 msgid "name" msgstr "name" -#: models.py:36 models.py:95 +#: models.py:35 models.py:95 msgid "slug" msgstr "slug" -#: models.py:43 +#: models.py:42 msgid "blog category" msgstr "blog category" -#: models.py:44 +#: models.py:43 msgid "blog categories" msgstr "blog categories" @@ -145,31 +145,31 @@ msgstr "Post meta description" msgid "Text" msgstr "Text" -#: models.py:156 +#: models.py:158 msgid "blog article" msgstr "blog article" -#: models.py:157 +#: models.py:159 msgid "blog articles" msgstr "blog articles" -#: models.py:201 models.py:226 +#: models.py:199 models.py:226 msgid "Articles" msgstr "Articles" -#: models.py:202 +#: models.py:200 msgid "The number of latests articles to be displayed." msgstr "The number of latests articles to be displayed." -#: models.py:204 +#: models.py:202 msgid "Show only the blog articles tagged with chosen tags." msgstr "Show only the blog articles tagged with chosen tags." -#: models.py:206 +#: models.py:204 msgid "Show only the blog articles tagged with chosen categories." msgstr "Show only the blog articles tagged with chosen categories." -#: models.py:223 templates/djangocms_blog/plugins/authors.html:3 +#: models.py:222 templates/djangocms_blog/plugins/authors.html:3 msgid "Authors" msgstr "Authors" diff --git a/djangocms_blog/locale/it/LC_MESSAGES/django.mo b/djangocms_blog/locale/it/LC_MESSAGES/django.mo index 4585fc8a020c533f28e27ce590d5255293261b44..8e8faefd9530101e355abcce721902c3972b6135 100644 GIT binary patch delta 44 zcmeB{?3Ubco1M!{*U(VG(Adh*aPm|3?L0n-dFiEz>8Vx ALI3~& delta 41 xcmeB{?3Ubco1M!<*T`JKz{JYPa`IF5?UPq>L~;2f=B1Y=rl(pdY~t)@1^^iR4SfIr