mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1664 from syndbg/patch-1
Nitpick Content decorators
This commit is contained in:
commit
5bf21abc66
1 changed files with 8 additions and 3 deletions
|
|
@ -90,7 +90,7 @@ class Content(object):
|
||||||
|
|
||||||
self.in_default_lang = (self.lang == default_lang)
|
self.in_default_lang = (self.lang == default_lang)
|
||||||
|
|
||||||
# create the slug if not existing, generate slug according to
|
# create the slug if not existing, generate slug according to
|
||||||
# setting of SLUG_ATTRIBUTE
|
# setting of SLUG_ATTRIBUTE
|
||||||
if not hasattr(self, 'slug'):
|
if not hasattr(self, 'slug'):
|
||||||
if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'):
|
if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'):
|
||||||
|
|
@ -308,8 +308,13 @@ class Content(object):
|
||||||
"""Dummy function"""
|
"""Dummy function"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
url = property(functools.partial(get_url_setting, key='url'))
|
@property
|
||||||
save_as = property(functools.partial(get_url_setting, key='save_as'))
|
def url(self):
|
||||||
|
return self.get_url_setting('url')
|
||||||
|
|
||||||
|
@property
|
||||||
|
def save_as(self):
|
||||||
|
return self.get_url_setting('save_as')
|
||||||
|
|
||||||
def _get_template(self):
|
def _get_template(self):
|
||||||
if hasattr(self, 'template') and self.template is not None:
|
if hasattr(self, 'template') and self.template is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue