X-Git-Url: https://git.0d.be/?p=panikweb.git;a=blobdiff_plain;f=panikweb%2Fpaniktags%2Ftemplatetags%2Fpaniktags.py;fp=panikweb%2Fpaniktags%2Ftemplatetags%2Fpaniktags.py;h=7ab2c37c094e8649c5a63e6f493bfa36632cab47;hp=58be364f4d8eb217f124d1e54eaf3f0050c14eea;hb=20554216478d822ebe77790660f4a5f4e4c50d17;hpb=e6b0b534dd9d822aa23d2e49506f680190ab6cf4 diff --git a/panikweb/paniktags/templatetags/paniktags.py b/panikweb/paniktags/templatetags/paniktags.py index 58be364..7ab2c37 100644 --- a/panikweb/paniktags/templatetags/paniktags.py +++ b/panikweb/paniktags/templatetags/paniktags.py @@ -362,6 +362,11 @@ def related_objects(object): return {'more_like_this': sqs.more_like_this(object)[:12]} +@register.simple_tag +def random_emissions(count=6): + return Emission.objects.filter(archived=False).order_by('?')[:count] + + @register.inclusion_tag('includes/topik.html', takes_context=True) def topik(context, topik): return {'page': topik}