git.ithinksw.org
/
philo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added "entry_dates" method to model to provide distinct yearly, monthly and daily...
[philo.git]
/
contrib
/
penfield
/
models.py
diff --git
a/contrib/penfield/models.py
b/contrib/penfield/models.py
index
eede5a4
..
0a46c54
100644
(file)
--- a/
contrib/penfield/models.py
+++ b/
contrib/penfield/models.py
@@
-15,6
+15,11
@@
class Blog(Entity, Titled):
def entry_tags(self):
""" Returns a QuerySet of Tags that are used on any entries in this blog. """
return Tag.objects.filter(blogentries__blog=self).distinct()
def entry_tags(self):
""" Returns a QuerySet of Tags that are used on any entries in this blog. """
return Tag.objects.filter(blogentries__blog=self).distinct()
+
+ @property
+ def entry_dates(self):
+ dates = {'year': self.entries.dates('date', 'year', order='DESC'), 'month': self.entries.dates('date', 'month', order='DESC'), 'day': self.entries.dates('date', 'day', order='DESC')}
+ return dates
register_value_model(Blog)
register_value_model(Blog)