Code cleanup

This commit is contained in:
Iacopo Spalletti 2015-09-26 10:38:57 +02:00
commit a1497360b1
8 changed files with 38 additions and 56 deletions

View file

@ -125,8 +125,8 @@ class BlogConfigAdmin(BaseAppHookConfig, TranslatableAdmin):
def get_config_fields(self):
return (
'app_title', 'paginate_by', 'set_author', 'config.default_published',
'config.use_placeholder'
'app_title', 'config.paginate_by', 'config.set_author', 'config.default_published',
'config.use_placeholder', 'config.use_abstract',
)
admin.site.register(BlogCategory, BlogCategoryAdmin)

View file

@ -56,7 +56,6 @@ class BlogAuthorPostsPlugin(BlogPlugin):
module = _('Blog')
name = _('Author Blog Articles')
model = AuthorEntriesPlugin
form = LatestEntriesForm
render_template = 'djangocms_blog/plugins/authors.html'
filter_horizontal = ['authors']

View file

@ -4,7 +4,6 @@ from __future__ import unicode_literals
import aldryn_apphooks_config.fields
import app_data.fields
import djangocms_text_ckeditor.fields
from cms.models import Page
from cms.utils.conf import get_languages
from django.db import models, migrations
@ -114,5 +113,10 @@ class Migration(migrations.Migration):
name='blogconfigtranslation',
unique_together=set([('language_code', 'master')]),
),
migrations.AlterField(
model_name='post',
name='sites',
field=models.ManyToManyField(to='sites.Site', help_text='Select sites in which to show the post. If none is set it will be visible in all the configured sites.', blank=True, verbose_name='Site(s)'),
),
migrations.RunPython(forwards, backwards)
]

View file

@ -113,10 +113,9 @@ class Post(ModelMeta, TranslatableModel):
enable_comments = models.BooleanField(verbose_name=_('enable comments on post'),
default=get_setting('ENABLE_COMMENTS'))
sites = models.ManyToManyField('sites.Site', verbose_name=_('Site(s)'), blank=True,
null=True,
help_text=_('Select sites in which to show the post. '
u'If none is set it will be '
u'visible in all the configured sites.'))
'If none is set it will be '
'visible in all the configured sites.'))
app_config = AppHookConfigField(BlogConfig, verbose_name=_('app. config'))
translations = TranslatedFields(