Merge pull request #38 from nephila/feature/user_model

Add support for custom user model
This commit is contained in:
Iacopo Spalletti 2014-09-07 05:33:14 +02:00
commit 78786ac8c0
30 changed files with 472 additions and 318 deletions

View file

@ -7,13 +7,14 @@ History
++++++++++++++++++++++ ++++++++++++++++++++++
* **INCOMPATIBLE CHANGE**: view names changed! * **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 * Toolbar items contextual to the current page
* Add support for canonical URLs * Add support for canonical URLs
* Add transifex support * Add transifex support
* Add social tags via django-meta-mixin * Add social tags via django-meta-mixin
* Per-post or site-wide comments enabling * Per-post or site-wide comments enabling
* Simpler TextField-based content editing for simpler blogs * Simpler TextField-based content editing for simpler blogs
* Add support for custom user models
0.1.0 (2014-03-06) 0.1.0 (2014-03-06)

View file

@ -1,65 +1,78 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys
from tempfile import mkdtemp from tempfile import mkdtemp
gettext = lambda s: s gettext = lambda s: s
HELPER_SETTINGS = { HELPER_SETTINGS = {
'NOSE_ARGS':[ 'NOSE_ARGS': [
'-s', '-s',
], ],
'ROOT_URLCONF':'tests.test_utils.urls', 'ROOT_URLCONF': 'tests.test_utils.urls',
'INSTALLED_APPS':[ 'INSTALLED_APPS': [
'django_nose', 'admin_enhancer',
'filer', 'filer',
'parler', 'parler',
'taggit', 'taggit',
'meta', 'meta',
'meta_mixin', 'meta_mixin',
'easy_thumbnails', 'easy_thumbnails',
'djangocms_text_ckeditor', 'djangocms_text_ckeditor',
'cmsplugin_filer_image', 'cmsplugin_filer_image',
'django_select2', 'django_select2',
'taggit_autosuggest', 'taggit_autosuggest',
'djangocms_blog', 'djangocms_blog',
], ],
'LANGUAGE_CODE':'en', 'LANGUAGE_CODE': 'en',
'LANGUAGES':( 'LANGUAGES': (
('en', gettext('English')), ('en', gettext('English')),
('fr', gettext('French')), ('fr', gettext('French')),
('it', gettext('Italiano')), ('it', gettext('Italiano')),
), ),
'CMS_LANGUAGES':{ 'CMS_LANGUAGES': {
1: [ 1: [
{ {
'code': 'en', 'code': 'en',
'name': gettext('English'), 'name': gettext('English'),
'public': True, 'public': True,
},
{
'code': 'it',
'name': gettext('Italiano'),
'public': True,
},
{
'code': 'fr',
'name': gettext('French'),
'public': True,
},
],
'default': {
'hide_untranslated': False,
}, },
{
'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', 'PARLER_LANGUAGES': {
'META_USE_OG_PROPERTIES':True, 1: (
'META_USE_TWITTER_PROPERTIES':True, {'code': 'en'},
'META_USE_GOOGLEPLUS_PROPERTIES':True, {'code': 'it'},
'THUMBNAIL_PROCESSORS':( {'code': 'fr'},
'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() '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')

View file

@ -1 +1 @@
__version__ = '0.2c1' __version__ = '0.2c2'

View file

@ -5,8 +5,8 @@ from django.utils.translation import ugettext_lazy as _
class BlogApp(CMSApp): class BlogApp(CMSApp):
name = _("Blog") name = _('Blog')
urls = ["djangocms_blog.urls"] urls = ['djangocms_blog.urls']
app_name = 'djangocms_blog' app_name = 'djangocms_blog'
apphook_pool.register(BlogApp) apphook_pool.register(BlogApp)

View file

@ -15,7 +15,7 @@ class BlogToolbar(CMSToolbar):
# TODO: Readd if not self.is_current_app condition when CMS 3.0.4 is released # 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'): if not self.request.user.has_perm('djangocms_blog.add_post'):
return # pragma: no cover 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') url = reverse('admin:djangocms_blog_post_changelist')
admin_menu.add_modal_item(_('Post list'), url=url) admin_menu.add_modal_item(_('Post list'), url=url)
url = reverse('admin:djangocms_blog_post_add') url = reverse('admin:djangocms_blog_post_add')

View file

@ -14,5 +14,5 @@ class LatestEntriesForm(forms.ModelForm):
class Media: class Media:
css = { css = {
'all': ('%sdjangocms_blog/css/%s' % (settings.STATIC_URL, 'all': ('%sdjangocms_blog/css/%s' % (settings.STATIC_URL,
"djangocms_blog_admin.css"),) 'djangocms_blog_admin.css'),)
} }

Binary file not shown.

View file

@ -0,0 +1,260 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: djangocms-blog\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-09-01 07:16+0200\n"
"PO-Revision-Date: 2014-03-29 15:29+0000\n"
"Last-Translator: Iacopo Spalletti\n"
"Language-Team: Arabic (http://www.transifex.com/projects/p/djangocms-blog/language/ar/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ar\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=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."

View file

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-11 13:11+0200\n" "POT-Creation-Date: 2014-09-01 07:16+0200\n"
"PO-Revision-Date: 2014-03-05 18:09+0100\n" "PO-Revision-Date: 2014-03-05 18:09+0100\n"
"Last-Translator: Iacopo Spalletti\n" "Last-Translator: Iacopo Spalletti\n"
"Language-Team: Italian <i.spalletti@nephila.it>\n" "Language-Team: Italian <i.spalletti@nephila.it>\n"
@ -18,7 +18,7 @@ msgstr ""
"X-Generator: Lokalize 1.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_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" msgid "Blog"
msgstr "Blog" msgstr "Blog"
@ -43,15 +43,15 @@ msgstr "Categories"
msgid "Archive" msgid "Archive"
msgstr "Archive" msgstr "Archive"
#: cms_toolbar.py:19 #: cms_toolbar.py:20
msgid "Post list" msgid "Post list"
msgstr "Post list" msgstr "Post list"
#: cms_toolbar.py:21 #: cms_toolbar.py:22
msgid "Add post" msgid "Add post"
msgstr "Add post" msgstr "Add post"
#: cms_toolbar.py:25 #: cms_toolbar.py:26
msgid "Edit Post" msgid "Edit Post"
msgstr "" msgstr ""
@ -60,31 +60,31 @@ msgstr ""
msgid "Blog articles on %(site_name)s" msgid "Blog articles on %(site_name)s"
msgstr "Blog articles on %(site_name)s" msgstr "Blog articles on %(site_name)s"
#: models.py:29 #: models.py:28
msgid "parent" msgid "parent"
msgstr "parent" msgstr "parent"
#: models.py:31 #: models.py:30
msgid "created at" msgid "created at"
msgstr "created at" msgstr "created at"
#: models.py:32 #: models.py:31
msgid "modified at" msgid "modified at"
msgstr "modified at" msgstr "modified at"
#: models.py:35 #: models.py:34
msgid "name" msgid "name"
msgstr "name" msgstr "name"
#: models.py:36 models.py:95 #: models.py:35 models.py:95
msgid "slug" msgid "slug"
msgstr "slug" msgstr "slug"
#: models.py:43 #: models.py:42
msgid "blog category" msgid "blog category"
msgstr "blog category" msgstr "blog category"
#: models.py:44 #: models.py:43
msgid "blog categories" msgid "blog categories"
msgstr "blog categories" msgstr "blog categories"
@ -145,31 +145,31 @@ msgstr "Post meta description"
msgid "Text" msgid "Text"
msgstr "Text" msgstr "Text"
#: models.py:156 #: models.py:158
msgid "blog article" msgid "blog article"
msgstr "blog article" msgstr "blog article"
#: models.py:157 #: models.py:159
msgid "blog articles" msgid "blog articles"
msgstr "blog articles" msgstr "blog articles"
#: models.py:201 models.py:226 #: models.py:199 models.py:226
msgid "Articles" msgid "Articles"
msgstr "Articles" msgstr "Articles"
#: models.py:202 #: models.py:200
msgid "The number of latests articles to be displayed." msgid "The number of latests articles to be displayed."
msgstr "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." msgid "Show only the blog articles tagged with chosen tags."
msgstr "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." msgid "Show only the blog articles tagged with chosen categories."
msgstr "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" msgid "Authors"
msgstr "Authors" msgstr "Authors"

View file

@ -48,7 +48,7 @@ class TaggedFilterItem(object):
def tag_list_slug(self, other_model=None, queryset=None): def tag_list_slug(self, other_model=None, queryset=None):
queryset = self.tag_list(other_model, queryset) 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): def tag_cloud(self, other_model=None, queryset=None, published=True):
from taggit.models import TaggedItem from taggit.models import TaggedItem
@ -70,9 +70,9 @@ class TaggedFilterItem(object):
class GenericDateTaggedManager(TaggedFilterItem, TranslationManager): class GenericDateTaggedManager(TaggedFilterItem, TranslationManager):
use_for_related_fields = True use_for_related_fields = True
start_date_field = "date_published" start_date_field = 'date_published'
end_date_field = "date_published_end" end_date_field = 'date_published_end'
publish_field = "publish" publish_field = 'publish'
def get_queryset(self, *args, **kwargs): def get_queryset(self, *args, **kwargs):
try: try:
@ -84,7 +84,7 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager):
queryset = self.published_future(queryset) queryset = self.published_future(queryset)
if self.start_date_field: if self.start_date_field:
return queryset.filter( return queryset.filter(
**{"%s__lte" % self.start_date_field: now()}) **{'%s__lte' % self.start_date_field: now()})
else: else:
return queryset return queryset
@ -93,8 +93,8 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager):
queryset = self.get_queryset().all() queryset = self.get_queryset().all()
if self.end_date_field: if self.end_date_field:
qfilter = ( qfilter = (
models.Q(**{"%s__gte" % self.end_date_field: now()}) models.Q(**{'%s__gte' % self.end_date_field: now()})
| models.Q(**{"%s__isnull" % self.end_date_field: True}) | models.Q(**{'%s__isnull' % self.end_date_field: True})
) )
queryset = queryset.filter(qfilter) queryset = queryset.filter(qfilter)
return queryset.filter(**{self.publish_field: True}) return queryset.filter(**{self.publish_field: True})
@ -104,8 +104,8 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager):
queryset = self.get_queryset().all() queryset = self.get_queryset().all()
if self.end_date_field: if self.end_date_field:
qfilter = ( qfilter = (
models.Q(**{"%s__lte" % self.end_date_field: now()}) models.Q(**{'%s__lte' % self.end_date_field: now()})
| models.Q(**{"%s__isnull" % self.end_date_field: False}) | models.Q(**{'%s__isnull' % self.end_date_field: False})
) )
queryset = queryset.filter(qfilter) queryset = queryset.filter(qfilter)
return queryset.filter(**{self.publish_field: True}) return queryset.filter(**{self.publish_field: True})
@ -119,7 +119,9 @@ class GenericDateTaggedManager(TaggedFilterItem, TranslationManager):
return self.get_queryset().active_translations(language_code=language) return self.get_queryset().active_translations(language_code=language)
def get_months(self, queryset=None): 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: if queryset is None:
queryset = self.get_queryset() queryset = self.get_queryset()
dates = queryset.values_list(self.start_date_field, flat=True) dates = queryset.values_list(self.start_date_field, flat=True)

View file

@ -1,10 +1,16 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models 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): class Migration(SchemaMigration):
def forwards(self, orm): def forwards(self, orm):
@ -53,10 +59,10 @@ class Migration(SchemaMigration):
# Adding model 'Post' # Adding model 'Post'
db.create_table(u'djangocms_blog_post', ( db.create_table(u'djangocms_blog_post', (
(u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), (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_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_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)), ('date_published_end', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
('publish', self.gf('django.db.models.fields.BooleanField')(default=False)), ('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', 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, ( db.create_table(m2m_table_name, (
('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)), ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
('authorentriesplugin', models.ForeignKey(orm[u'djangocms_blog.authorentriesplugin'], null=False)), ('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']) 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'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
}, },
u'auth.user': { user_model_label: {
'Meta': {'object_name': 'User'}, 'Meta': {'object_name': User.__name__, 'db_table': "'%s'" % User._meta.db_table},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', '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': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', 'db_table': "u'cmsplugin_authorentriesplugin'", '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -258,7 +264,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,22 +1,21 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
def forwards(self, orm): def forwards(self, orm):
# Changing field 'Post.author' # 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): def backwards(self, orm):
raise RuntimeError("Cannot reverse this migration. 'Post.author' and its values cannot be restored.") 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 # The following code is provided here to aid in writing a correct migration
# Changing field 'Post.author' # 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 = { models = {
u'auth.group': { u'auth.group': {
@ -87,7 +86,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.authorentriesplugin': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', 'db_table': "u'cmsplugin_authorentriesplugin'", '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -115,7 +114,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,20 +1,19 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
def forwards(self, orm): def forwards(self, orm):
db.rename_table(u'cmsplugin_latestpostsplugin', u'djangocms_blog_latestpostsplugin') 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_authorentriesplugin', u'djangocms_blog_authorentriesplugin')
def backwards(self, orm): def backwards(self, orm):
db.rename_table(u'djangocms_blog_latestpostsplugin', u'cmsplugin_latestpostsplugin') 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_authorentriesplugin', u'cmsplugin_authorentriesplugin')
models = { models = {
@ -86,7 +85,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.authorentriesplugin': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -114,7 +113,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
@ -88,7 +87,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.authorentriesplugin': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -116,7 +115,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
@ -88,7 +87,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.authorentriesplugin': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -116,7 +115,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255', '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
@ -88,7 +87,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.authorentriesplugin': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -116,7 +115,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), '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'}), '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- 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.db import db
from south.v2 import SchemaMigration from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration): class Migration(SchemaMigration):
@ -88,7 +87,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.authorentriesplugin': { u'djangocms_blog.authorentriesplugin': {
'Meta': {'object_name': 'AuthorEntriesPlugin', '_ormbases': ['cms.CMSPlugin']}, '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'}), 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'}) 'latest_posts': ('django.db.models.fields.IntegerField', [], {'default': '5'})
}, },
@ -116,7 +115,7 @@ class Migration(SchemaMigration):
}, },
u'djangocms_blog.post': { u'djangocms_blog.post': {
'Meta': {'ordering': "('-date_published', '-date_created')", 'object_name': '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']"}), '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'}), '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_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'}), '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'}), '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'}), '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']"}), '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'}), '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'}) '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'}), u'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), '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']"}), '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'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}), u'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),

View file

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from cms.models import PlaceholderField, CMSPlugin from cms.models import PlaceholderField, CMSPlugin
from cmsplugin_filer_image.models import ThumbnailOption 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.core.urlresolvers import reverse
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
@ -62,7 +62,8 @@ class Post(ModelMeta, TranslatableModel):
""" """
Blog post 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') related_name='djangocms_blog_post_author')
date_created = models.DateTimeField(auto_now_add=True) date_created = models.DateTimeField(auto_now_add=True)
@ -100,7 +101,7 @@ class Post(ModelMeta, TranslatableModel):
post_text=HTMLField(_('Text'), default='', blank=True), post_text=HTMLField(_('Text'), default='', blank=True),
meta={'unique_together': (('language_code', 'slug'),)} meta={'unique_together': (('language_code', 'slug'),)}
) )
content = PlaceholderField("post_content") content = PlaceholderField('post_content')
objects = GenericDateTaggedManager() objects = GenericDateTaggedManager()
tags = TaggableManager(blank=True, related_name='djangocms_blog_tags') tags = TaggableManager(blank=True, related_name='djangocms_blog_tags')
@ -133,7 +134,7 @@ class Post(ModelMeta, TranslatableModel):
} }
def get_keywords(self): 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): def get_description(self):
description = self.safe_translation_getter('meta_description', any_language=True) description = self.safe_translation_getter('meta_description', any_language=True)
@ -148,7 +149,7 @@ class Post(ModelMeta, TranslatableModel):
def get_tags(self): def get_tags(self):
taglist = [tag.name for tag in self.tags.all()] taglist = [tag.name for tag in self.tags.all()]
return ",".join(taglist) return ','.join(taglist)
def get_author(self): def get_author(self):
return self.author return self.author
@ -156,7 +157,7 @@ class Post(ModelMeta, TranslatableModel):
class Meta: class Meta:
verbose_name = _('blog article') verbose_name = _('blog article')
verbose_name_plural = _('blog articles') verbose_name_plural = _('blog articles')
ordering = ("-date_published", "-date_created") ordering = ('-date_published', '-date_created')
get_latest_by = 'date_published' get_latest_by = 'date_published'
def __unicode__(self): def __unicode__(self):
@ -203,7 +204,7 @@ class LatestPostsPlugin(CMSPlugin):
help_text=_('Show only the blog articles tagged with chosen categories.')) help_text=_('Show only the blog articles tagged with chosen categories.'))
def __unicode__(self): 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): def copy_relations(self, oldinstance):
self.tags = oldinstance.tags.all() self.tags = oldinstance.tags.all()
@ -217,14 +218,17 @@ class LatestPostsPlugin(CMSPlugin):
class AuthorEntriesPlugin(CMSPlugin): class AuthorEntriesPlugin(CMSPlugin):
authors = models.ManyToManyField(User, verbose_name=_('Authors'), authors = models.ManyToManyField(
limit_choices_to={'djangocms_blog_post_author__publish': True} 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.')) latest_posts = models.IntegerField(
_(u'Articles'), default=settings.BLOG_LATEST_POSTS,
help_text=_('The number of author articles to be displayed.')
)
def __unicode__(self): 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): def copy_relations(self, oldinstance):
self.authors = oldinstance.authors.all() self.authors = oldinstance.authors.all()

View file

@ -7,7 +7,7 @@
{% block blog_meta %} {% block blog_meta %}
<ul class="post-detail"> <ul class="post-detail">
<li> <li>
{% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.username %}">{{ post.author.get_full_name }}</a> {% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.get_username %}">{{ post.author.get_full_name }}</a>
</li> </li>
<li> <li>
{{ post.date_published|date:"M d, Y" }} {{ post.date_published|date:"M d, Y" }}

View file

@ -3,7 +3,7 @@
<h3>{% trans "Authors" %}</h3> <h3>{% trans "Authors" %}</h3>
<ul class="blog-authors"> <ul class="blog-authors">
{% for author in instance.get_authors %} {% for author in instance.get_authors %}
<li><a href="{% url 'djangocms_blog:posts-author' author.username %}"> <li><a href="{% url 'djangocms_blog:posts-author' author.get_username %}">
{{ author.get_full_name }} {{ author.get_full_name }}
<span>( <span>(
{% if author.count > 0 %} {% if author.count > 0 %}

View file

@ -13,7 +13,7 @@
{% block blog_meta %} {% block blog_meta %}
<ul class="post-detail"> <ul class="post-detail">
<li> <li>
{% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.username %}">{{ post.author.get_full_name }}</a> {% trans "by" %} <a href="{% url 'djangocms_blog:posts-author' post.author.get_username %}">{{ post.author.get_full_name }}</a>
</li> </li>
<li> <li>
{{ post.date_published|date:"M d, Y" }} {{ post.date_published|date:"M d, Y" }}

View file

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.utils.translation import get_language from django.contrib.auth import get_user_model
from django.utils.timezone import now
from django.contrib.auth.models import User
from django.core.urlresolvers import resolve 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 django.views.generic import ListView, DetailView
from parler.views import ViewUrlMixin, TranslatableSlugMixin from parler.views import ViewUrlMixin, TranslatableSlugMixin
@ -11,6 +11,8 @@ from .models import Post, BlogCategory, BLOG_CURRENT_POST_IDENTIFIER
from .settings import (BLOG_PAGINATION, BLOG_POSTS_LIST_TRUNCWORDS_COUNT, from .settings import (BLOG_PAGINATION, BLOG_POSTS_LIST_TRUNCWORDS_COUNT,
BLOG_USE_PLACEHOLDER) BLOG_USE_PLACEHOLDER)
User = get_user_model()
class BaseBlogView(ViewUrlMixin): class BaseBlogView(ViewUrlMixin):
@ -29,7 +31,7 @@ class BaseBlogView(ViewUrlMixin):
class PostListView(BaseBlogView, ListView): class PostListView(BaseBlogView, ListView):
model = Post model = Post
context_object_name = 'post_list' context_object_name = 'post_list'
template_name = "djangocms_blog/post_list.html" template_name = 'djangocms_blog/post_list.html'
paginate_by = BLOG_PAGINATION paginate_by = BLOG_PAGINATION
view_url_name = 'djangocms_blog:posts-latest' view_url_name = 'djangocms_blog:posts-latest'
@ -42,7 +44,7 @@ class PostListView(BaseBlogView, ListView):
class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView): class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView):
model = Post model = Post
context_object_name = 'post' context_object_name = 'post'
template_name = "djangocms_blog/post_detail.html" template_name = 'djangocms_blog/post_detail.html'
slug_field = 'slug' slug_field = 'slug'
view_url_name = 'djangocms_blog:post-detail' view_url_name = 'djangocms_blog:post-detail'
@ -57,7 +59,7 @@ class PostDetailView(TranslatableSlugMixin, BaseBlogView, DetailView):
class PostArchiveView(BaseBlogView, ListView): class PostArchiveView(BaseBlogView, ListView):
model = Post model = Post
context_object_name = 'post_list' context_object_name = 'post_list'
template_name = "djangocms_blog/post_list.html" template_name = 'djangocms_blog/post_list.html'
date_field = 'date_published' date_field = 'date_published'
allow_empty = True allow_empty = True
allow_future = True allow_future = True
@ -67,9 +69,9 @@ class PostArchiveView(BaseBlogView, ListView):
def get_queryset(self): def get_queryset(self):
qs = super(PostArchiveView, self).get_queryset() qs = super(PostArchiveView, self).get_queryset()
if 'month' in self.kwargs: 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: 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 return qs
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
@ -83,7 +85,7 @@ class PostArchiveView(BaseBlogView, ListView):
class TaggedListView(BaseBlogView, ListView): class TaggedListView(BaseBlogView, ListView):
model = Post model = Post
context_object_name = 'post_list' context_object_name = 'post_list'
template_name = "djangocms_blog/post_list.html" template_name = 'djangocms_blog/post_list.html'
paginate_by = BLOG_PAGINATION paginate_by = BLOG_PAGINATION
view_url_name = 'djangocms_blog:posts-tagged' view_url_name = 'djangocms_blog:posts-tagged'
@ -100,25 +102,25 @@ class TaggedListView(BaseBlogView, ListView):
class AuthorEntriesView(BaseBlogView, ListView): class AuthorEntriesView(BaseBlogView, ListView):
model = Post model = Post
context_object_name = 'post_list' context_object_name = 'post_list'
template_name = "djangocms_blog/post_list.html" template_name = 'djangocms_blog/post_list.html'
paginate_by = BLOG_PAGINATION paginate_by = BLOG_PAGINATION
view_url_name = 'djangocms_blog:posts-authors' view_url_name = 'djangocms_blog:posts-authors'
def get_queryset(self): def get_queryset(self):
qs = super(AuthorEntriesView, self).get_queryset() qs = super(AuthorEntriesView, self).get_queryset()
if 'username' in self.kwargs: 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 return qs
def get_context_data(self, **kwargs): 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) return super(AuthorEntriesView, self).get_context_data(**kwargs)
class CategoryEntriesView(BaseBlogView, ListView): class CategoryEntriesView(BaseBlogView, ListView):
model = Post model = Post
context_object_name = 'post_list' context_object_name = 'post_list'
template_name = "djangocms_blog/post_list.html" template_name = 'djangocms_blog/post_list.html'
_category = None _category = None
paginate_by = BLOG_PAGINATION paginate_by = BLOG_PAGINATION
view_url_name = 'djangocms_blog:posts-category' view_url_name = 'djangocms_blog:posts-category'

View file

@ -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)

View file

@ -7,16 +7,19 @@ import os
from cms.utils.i18n import get_language_list from cms.utils.i18n import get_language_list
from cmsplugin_filer_image.models import ThumbnailOption from cmsplugin_filer_image.models import ThumbnailOption
from django.conf import settings 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.core.files import File as DjangoFile
from django.http import SimpleCookie from django.http import SimpleCookie
from django.test import TestCase, RequestFactory from django.test import TestCase, RequestFactory
from django.utils.translation import activate from django.utils.translation import activate
from filer.models import File, Image 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 six import StringIO
from djangocms_blog.models import BlogCategory, Post from djangocms_blog.models import BlogCategory, Post
from djangocms_helper.utils import create_user
User = get_user_model()
class BaseTest(TestCase): class BaseTest(TestCase):
@ -52,9 +55,9 @@ class BaseTest(TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
cls.request_factory = RequestFactory() cls.request_factory = RequestFactory()
cls.user = User.objects.create(username='admin', is_staff=True, is_superuser=True) cls.user = create_user('admin', 'admin@admin.com', 'admin', is_staff=True, is_superuser=True)
cls.user_staff = User.objects.create(username='staff', is_staff=True) cls.user_staff = create_user('staff', 'staff@admin.com', 'staff', is_staff=True)
cls.user_normal = User.objects.create(username='normal') cls.user_normal = create_user('normal', 'normal@admin.com', 'normal')
def setUp(self): def setUp(self):
activate('en') activate('en')

View file

@ -2,6 +2,7 @@
from cms.api import add_plugin from cms.api import add_plugin
from cms.utils.copy_plugins import copy_plugins_to from cms.utils.copy_plugins import copy_plugins_to
from cms.utils.plugins import downcast_plugins from cms.utils.plugins import downcast_plugins
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.timezone import now from django.utils.timezone import now
import parler import parler
@ -115,8 +116,12 @@ class ModelsTest(BaseTest):
# No fallback # No fallback
parler.appsettings.PARLER_LANGUAGES['default']['hide_untranslated'] = True 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) self.assertEqual(len(Post.objects.filter_by_language('it')), 1)
parler.appsettings.PARLER_LANGUAGES['default']['hide_untranslated'] = False 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): def test_tag_cloud(self):
post1 = self._get_post(self.data['en'][0]) post1 = self._get_post(self.data['en'][0])

View file

@ -45,7 +45,7 @@ class PluginTest(BaseTest):
request = self.get_page_request(page1, self.user, r'/en/blog/', lang_code='en', edit=True) request = self.get_page_request(page1, self.user, r'/en/blog/', lang_code='en', edit=True)
context = RequestContext(request, {}) context = RequestContext(request, {})
rendered = plugin.render_plugin(context, ph) 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) self.assertTrue(rendered.find('2 articles') > -1)
def test_plugin_tags(self): def test_plugin_tags(self):

View file

@ -16,6 +16,7 @@ urlpatterns = patterns('',
url(r'^media/cms/(?P<path>.*)$', 'django.views.static.serve', url(r'^media/cms/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': get_cms_setting('MEDIA_ROOT'), 'show_indexes': True}), {'document_root': get_cms_setting('MEDIA_ROOT'), 'show_indexes': True}),
url(r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'), url(r'^jsi18n/(?P<packages>\S+?)/$', 'django.views.i18n.javascript_catalog'),
url(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
) )
urlpatterns += staticfiles_urlpatterns() urlpatterns += staticfiles_urlpatterns()

View file

@ -3,6 +3,7 @@ from django.contrib.auth.models import AnonymousUser
from django.http import Http404 from django.http import Http404
from django.utils.translation import activate from django.utils.translation import activate
from django.utils.timezone import now from django.utils.timezone import now
from djangocms_blog.models import Post
from djangocms_blog.feeds import LatestEntriesFeed, TagFeed from djangocms_blog.feeds import LatestEntriesFeed, TagFeed
from djangocms_blog.sitemaps import BlogSitemap from djangocms_blog.sitemaps import BlogSitemap
from djangocms_blog.views import (PostListView, PostDetailView, from djangocms_blog.views import (PostListView, PostDetailView,
@ -132,7 +133,7 @@ class ViewTest(BaseTest):
activate('en') activate('en')
view_obj = AuthorEntriesView() view_obj = AuthorEntriesView()
view_obj.request = request view_obj.request = request
view_obj.kwargs = {'username': 'admin'} view_obj.kwargs = {'username': self.user.get_username()}
qs = view_obj.get_queryset() qs = view_obj.get_queryset()
self.assertEqual(qs.count(), 2) self.assertEqual(qs.count(), 2)
self.assertEqual(set(qs), set([post1, post2])) self.assertEqual(set(qs), set([post1, post2]))