Reuse _get_meta_value from django-meta

This commit is contained in:
Iacopo Spalletti 2016-04-09 07:25:27 +02:00
parent 9c7d1e8cbf
commit 97f3743771
3 changed files with 3 additions and 17 deletions

View File

@ -236,21 +236,7 @@ class Post(KnockerModel, ModelMeta, TranslatableModel):
Retrieves django-meta attributes from apphook config instance
:param param: django-meta attribute passed as key
"""
attr = None
value = getattr(self.app_config, param)
if value:
attr = getattr(self, value, None)
if attr is not None:
if callable(attr):
try:
data = attr(param)
except TypeError:
data = attr()
else:
data = attr
else:
data = value
return data
return self._get_meta_value(param, getattr(self.app_config, param)) or ''
def get_title(self):
title = self.safe_translation_getter('meta_title', any_language=True)

View File

@ -36,7 +36,7 @@ setup(
'django-taggit-autosuggest',
'djangocms-text-ckeditor',
'cmsplugin-filer',
'django-meta>=1.1',
'django-meta>=1.2',
'aldryn-apphooks-config>=0.2.6',
'djangocms-apphook-setup',
'aldryn-search'

View File

@ -20,7 +20,7 @@ deps =
cms32: https://github.com/divio/django-cms/archive/release/3.2.x.zip
knocker: https://github.com/divio/django-cms/archive/release/3.2.x.zip
knocker: https://github.com/nephila/django-knocker/archive/master.zip?0.1.1
django-meta>=1.0b3
django-meta>=1.2
https://github.com/nephila/djangocms-helper/archive/develop.zip
py26: unittest2
https://github.com/aldryn/aldryn-apphooks-config/archive/master.zip