From 238e61150a152bc885650e274f2ef969d47c43d9 Mon Sep 17 00:00:00 2001 From: Kotiuk Nazarii Date: Mon, 11 May 2015 23:41:26 +0300 Subject: [PATCH] 25% filter --- settings/templatetags/template_filters.py | 5 +++++ templates/client/exposition/exposition_list.html | 1 + 2 files changed, 6 insertions(+) diff --git a/settings/templatetags/template_filters.py b/settings/templatetags/template_filters.py index 37d44578..667ebc75 100644 --- a/settings/templatetags/template_filters.py +++ b/settings/templatetags/template_filters.py @@ -156,6 +156,11 @@ def timetable_by_day(qs, day): def random_social(value): return bool(random.getrandbits(1)) +@register.filter +def fourth(value): + # return almost in 75% cases True in 25% False + return bool(random.randrange(0,4)) + @register.filter def is_current_page(request, param): return request.path == param diff --git a/templates/client/exposition/exposition_list.html b/templates/client/exposition/exposition_list.html index 8fc3bfd1..066233b2 100644 --- a/templates/client/exposition/exposition_list.html +++ b/templates/client/exposition/exposition_list.html @@ -24,6 +24,7 @@ {% block page_title %}

{% if meta %}{{ meta.h1 }}{% else %}{% trans 'Выставки' %}{% endif %}

+
{% include 'includes/exposition/catalog_filter_period.html' %}