forked from rc/aircox
cms.sections.Similar; publication content optional
This commit is contained in:
parent
acd0737d5d
commit
7ba887b3cd
|
@ -144,6 +144,7 @@ class Post (models.Model, Routable):
|
||||||
content = models.TextField (
|
content = models.TextField (
|
||||||
_('description'),
|
_('description'),
|
||||||
default = '',
|
default = '',
|
||||||
|
blank = True, null = True,
|
||||||
)
|
)
|
||||||
image = models.ImageField(
|
image = models.ImageField(
|
||||||
blank = True, null = True,
|
blank = True, null = True,
|
||||||
|
|
|
@ -317,6 +317,28 @@ class List(Section):
|
||||||
return self.paginate_by and self.paginate_by < len(self.object_list)
|
return self.paginate_by and self.paginate_by < len(self.object_list)
|
||||||
|
|
||||||
|
|
||||||
|
class Similar(List):
|
||||||
|
"""
|
||||||
|
Section that uses tags to render similar objects of a given one.
|
||||||
|
Note that the list is not a queryset, but the sorted result of
|
||||||
|
taggit's similar_objects function.
|
||||||
|
"""
|
||||||
|
title = _('Similar publications')
|
||||||
|
models = None
|
||||||
|
"""
|
||||||
|
List of models allowed in the resulting list. If not set, all models
|
||||||
|
are available.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def get_object_list(self):
|
||||||
|
if not self.object:
|
||||||
|
return
|
||||||
|
|
||||||
|
qs = self.object.tags.similar_objects()
|
||||||
|
qs.sort(key = lambda post: post.date, reverse=True)
|
||||||
|
return qs
|
||||||
|
|
||||||
|
|
||||||
class Comments(List):
|
class Comments(List):
|
||||||
"""
|
"""
|
||||||
Section used to render comment form and comments list. It renders the
|
Section used to render comment form and comments list. It renders the
|
||||||
|
|
17
notes.md
17
notes.md
|
@ -5,21 +5,17 @@
|
||||||
# TODO:
|
# TODO:
|
||||||
- general:
|
- general:
|
||||||
- timezone shit
|
- timezone shit
|
||||||
|
- translation
|
||||||
|
|
||||||
- programs:
|
- programs:
|
||||||
- schedule:
|
- tests:
|
||||||
- (old) schedule.to_string unused? commented
|
- sound_monitor
|
||||||
- write more tests
|
|
||||||
- sounds:
|
|
||||||
- check that a sound is available when uploading too
|
|
||||||
- one sound, one diffusion
|
|
||||||
-> sound_monitor
|
|
||||||
-> liquidsoap
|
|
||||||
-> tests: sound_monitor, liquidsoap (monitor)
|
|
||||||
|
|
||||||
- liquidsoap:
|
- liquidsoap:
|
||||||
- update rc's supervisor scripts
|
- update rc's supervisor scripts
|
||||||
- check when a played sound has a temp blank
|
- tests:
|
||||||
|
- monitor
|
||||||
|
- check when a played sound has a temp blank
|
||||||
|
|
||||||
- cms:
|
- cms:
|
||||||
- empty content -> empty string
|
- empty content -> empty string
|
||||||
|
@ -33,7 +29,6 @@
|
||||||
- admin cms
|
- admin cms
|
||||||
- content management -> do we use a markup language?
|
- content management -> do we use a markup language?
|
||||||
- sections:
|
- sections:
|
||||||
- similar articles (using tags)
|
|
||||||
- calendar
|
- calendar
|
||||||
- article list with the focus
|
- article list with the focus
|
||||||
-> set html attribute based on values that are public
|
-> set html attribute based on values that are public
|
||||||
|
|
Loading…
Reference in New Issue
Block a user