From 875c4a5e05d818c776be3019506921b863b13dc0 Mon Sep 17 00:00:00 2001 From: Anton Antonov Date: Tue, 17 Mar 2015 01:23:29 +0200 Subject: [PATCH] Nitpick Content decorators A bit more readable this way. --- pelican/contents.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 96466a94..005d045c 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -90,7 +90,7 @@ class Content(object): 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 if not hasattr(self, 'slug'): if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'): @@ -308,8 +308,13 @@ class Content(object): """Dummy function""" pass - url = property(functools.partial(get_url_setting, key='url')) - save_as = property(functools.partial(get_url_setting, key='save_as')) + @property + 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): if hasattr(self, 'template') and self.template is not None: