summaryrefslogtreecommitdiff
path: root/gstudio/templatetags/gstudio_tags.py
diff options
context:
space:
mode:
authorhorntail <nktsrd@gmail.com>2012-07-13 15:13:32 +0530
committerhorntail <nktsrd@gmail.com>2012-07-13 15:13:32 +0530
commitbceb5db463caf067fd1392a2ee83f81c4247c675 (patch)
tree70abecc48ff738f1176b552fec75278123bc6516 /gstudio/templatetags/gstudio_tags.py
parent527ab688a8608ded5fc854cf8641228181efa981 (diff)
parent06f170eae6261d894b9651e549d42abdfcecf46c (diff)
downloadgnowsys-bceb5db463caf067fd1392a2ee83f81c4247c675.tar.gz
merged with supriya's orgitdown code
Diffstat (limited to 'gstudio/templatetags/gstudio_tags.py')
-rw-r--r--gstudio/templatetags/gstudio_tags.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/gstudio/templatetags/gstudio_tags.py b/gstudio/templatetags/gstudio_tags.py
index d4152f5e..ad1d7e66 100644
--- a/gstudio/templatetags/gstudio_tags.py
+++ b/gstudio/templatetags/gstudio_tags.py
@@ -218,6 +218,17 @@ def get_calendar_nodetypes(context, year=None, month=None,
def get_recent_comments(number=5, template='gstudio/tags/recent_comments.html'):
"""Return the most recent comments"""
# Using map(smart_unicode... fix bug related to issue #8554
+
+ comments = get_comment_model().objects.filter(is_public=True).order_by('-submit_date')[:number]
+
+ return {'template': template,
+ 'comments': comments}
+
+
+@register.inclusion_tag('gstudio/tags/dummy.html')
+def get_recent_oldcomments(number=5, template='gstudio/tags/recent_comments.html'):
+ """Return the most recent comments"""
+ # Using map(smart_unicode... fix bug related to issue #8554
nodetype_published_pks = map(smart_unicode,
Nodetype.published.values_list('id', flat=True))
content_type = ContentType.objects.get_for_model(Nodetype)
@@ -230,7 +241,6 @@ def get_recent_comments(number=5, template='gstudio/tags/recent_comments.html'):
return {'template': template,
'comments': comments}
-
@register.inclusion_tag('gstudio/tags/dummy.html')
def get_recent_linkbacks(number=5,
template='gstudio/tags/recent_linkbacks.html'):