From 4f63e2eca861d597c1041bbf58c63ea4ea3e9a61 Mon Sep 17 00:00:00 2001 From: Primal Pappachan Date: Tue, 20 Mar 2012 11:22:17 +0530 Subject: range filter template tag, basic complete page added --- allotter/templatetags/__init__.py | 0 allotter/templatetags/range_filter.py | 27 +++++++++++++++++++++++++++ template/allotter/complete.html | 12 ++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 allotter/templatetags/__init__.py create mode 100644 allotter/templatetags/range_filter.py create mode 100644 template/allotter/complete.html diff --git a/allotter/templatetags/__init__.py b/allotter/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/allotter/templatetags/range_filter.py b/allotter/templatetags/range_filter.py new file mode 100644 index 0000000..1ce43d8 --- /dev/null +++ b/allotter/templatetags/range_filter.py @@ -0,0 +1,27 @@ +##Credits : http://djangosnippets.org/snippets/1357/ + +from django.template import Library + +register = Library() + +@register.filter +def get_range( value ): + """ + Filter - returns a list containing range made from given value + Usage (in template): + + + + Results with the HTML: + + + Instead of 3 one may use the variable set in the views + """ + return range( value ) + diff --git a/template/allotter/complete.html b/template/allotter/complete.html new file mode 100644 index 0000000..1759c30 --- /dev/null +++ b/template/allotter/complete.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block title %}Options saved.{% endblock %} + + +{% block content %} + +

Thank you, your options have been saved to the database

+ +{% endblock content %} + + -- cgit