add DiffusionManager, use it

This commit is contained in:
bkfox
2016-07-18 16:27:09 +02:00
parent d3e05211c3
commit 6b7255112d
6 changed files with 108 additions and 71 deletions

View File

@ -147,7 +147,12 @@ class Post (models.Model, Routable):
)
title = models.CharField (
_('title'),
max_length = 64,
)
subtitle = models.CharField (
_('subtitle'),
max_length = 128,
blank = True, null = True,
)
content = models.TextField (
_('description'),
@ -192,6 +197,8 @@ class Post (models.Model, Routable):
"""
Return an url to the post detail view.
"""
if not self.pk:
return ''
return self.reverse(
routes.DetailRoute,
pk = self.pk, slug = slugify(self.title)
@ -437,11 +444,6 @@ class RelatedPost (Post, metaclass = RelatedMeta):
note: bound values can be any value, not only Django field.
"""
defaults = None
"""
dict of `post_attr: value` that gives default value for the given
fields.
"""
post_to_rel = False
"""
update related object when the post is saved, using bindings