@register.inclusion_tag('zinnia/tags/dummy.html')
def get_recent_linkbacks(number=5, template='zinnia/tags/linkbacks_recent.html'):
 entry_published_pks = map(smart_text, Entry.published.values_list('id', flat=True))
 content_type = ContentType.objects.get_for_model(Entry)
 linkbacks = get_comment_model().objects.filter(content_type=content_type, object_pk__in=entry_published_pks, flags__flag__in=[PINGBACK, TRACKBACK], is_public=True).order_by('-pk')[:number]
 linkbacks = linkbacks.prefetch_related('content_object')
 return {'template': template, 'linkbacks': linkbacks}

@ register . inclusion_tag ( 'zinnia/tags/dummy.html' ) def get_recent_linkbacks ( number = 5 , template = 'zinnia/tags/linkbacks_recent.html' ) : entry_published_pks = map ( smart_text , Entry . published . values_list ( 'id' , flat = True ) ) content_type = ContentType . objects . get_for_model ( Entry ) linkbacks = get_comment_model ( ) . objects . filter ( content_type = content_type , object_pk__in = entry_published_pks , flags__flag__in = [ PINGBACK , TRACKBACK ] , is_public = True ) . order_by ( '-pk' ) [ : number ] linkbacks = linkbacks . prefetch_related ( 'content_object' ) return { 'template' : template , 'linkbacks' : linkbacks }
return the most recent linkbacks .