Update docs

This commit is contained in:
Iacopo Spalletti 2016-03-26 01:25:40 +01:00
commit 6c7e1b72f8
3 changed files with 20 additions and 0 deletions

View file

@ -37,6 +37,9 @@ try:
from knocker.mixins import KnockerModel
except ImportError:
class KnockerModel(object):
"""
Stub class if django-knocker is not installed
"""
pass
@ -293,6 +296,9 @@ class Post(KnockerModel, ModelMeta, TranslatableModel):
@property
def is_published(self):
"""
Checks wether the blog post is *really* published by checking publishing dates too
"""
return (self.publish and
(self.date_published and self.date_published <= timezone.now()) and
(self.date_published_end is None or self.date_published_end > timezone.now())