git.ithinksw.org
/
philo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11f1c38
)
Added "entry_dates" method to model to provide distinct yearly, monthly and daily...
author
Kriti Godey
<kriti.godey@gmail.com>
Fri, 23 Jul 2010 14:06:51 +0000
(19:36 +0530)
committer
Kriti Godey
<kriti.godey@gmail.com>
Fri, 23 Jul 2010 14:29:04 +0000
(19:59 +0530)
contrib/penfield/models.py
patch
|
blob
|
history
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()
+
+ @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)