From 784e62d0c38fbf0cc4b5e67e26354b0e0a261fc2 Mon Sep 17 00:00:00 2001 From: Dhiru Date: Tue, 10 Jul 2012 16:43:46 +0530 Subject: changes done in gstudio_tags.py --- gstudio/templatetags/gstudio_tags.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gstudio/templatetags') diff --git a/gstudio/templatetags/gstudio_tags.py b/gstudio/templatetags/gstudio_tags.py index 47dbbff..5c3c8a8 100644 --- a/gstudio/templatetags/gstudio_tags.py +++ b/gstudio/templatetags/gstudio_tags.py @@ -217,6 +217,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) @@ -229,7 +240,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'): -- cgit v1.1