diff --git a/common/templatetags/tags.py b/common/templatetags/tags.py index cab3686..d19d415 100644 --- a/common/templatetags/tags.py +++ b/common/templatetags/tags.py @@ -10,6 +10,6 @@ def getattr_filter(obj, attr): return getattr(obj, attr, '') -@register.simple_tag -def get_query_param(request, param_name): - return request.GET.get(param_name, '') +@register.filter +def get_value(dictionary, key): + return dictionary.get(key) diff --git a/templates/filter.html b/templates/filter.html index 5ee6117..3eef1e2 100644 --- a/templates/filter.html +++ b/templates/filter.html @@ -1,3 +1,5 @@ +{% load tags %} +
{% csrf_token %}
@@ -5,21 +7,22 @@ {% if filter.type == 'text' %}
- +
{% elif filter.type == 'select' %}
{% elif filter.type == 'date' %}
- +
{% endif %} {% endfor %} @@ -27,4 +30,4 @@
-
\ No newline at end of file +