diff options
author | horntail <nktsrd@gmail.com> | 2012-07-13 15:13:32 +0530 |
---|---|---|
committer | horntail <nktsrd@gmail.com> | 2012-07-13 15:13:32 +0530 |
commit | bceb5db463caf067fd1392a2ee83f81c4247c675 (patch) | |
tree | 70abecc48ff738f1176b552fec75278123bc6516 /gstudio/templatetags/gstudio_tags.py | |
parent | 527ab688a8608ded5fc854cf8641228181efa981 (diff) | |
parent | 06f170eae6261d894b9651e549d42abdfcecf46c (diff) | |
download | gnowsys-bceb5db463caf067fd1392a2ee83f81c4247c675.tar.gz |
merged with supriya's orgitdown code
Diffstat (limited to 'gstudio/templatetags/gstudio_tags.py')
-rw-r--r-- | gstudio/templatetags/gstudio_tags.py | 12 |
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'): |