From 56f4c3c79f01fe1a5faa6e04e6e061de183ab7b2 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 10 Nov 2011 21:29:22 +0530 Subject: [PATCH] make_li template tag added --- printaform/formaprint/templatetags/__init__.py | 0 printaform/formaprint/templatetags/random.py | 12 ++++++++++++ 2 files changed, 12 insertions(+) create mode 100644 printaform/formaprint/templatetags/__init__.py create mode 100644 printaform/formaprint/templatetags/random.py diff --git a/printaform/formaprint/templatetags/__init__.py b/printaform/formaprint/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/printaform/formaprint/templatetags/random.py b/printaform/formaprint/templatetags/random.py new file mode 100644 index 0000000..0ecf4a1 --- /dev/null +++ b/printaform/formaprint/templatetags/random.py @@ -0,0 +1,12 @@ +from django import template + +register = template.Library() + +def make_li(value): + lines = value.split("\n") + ret = '' + for l in lines: + ret += "
  • %s
  • " % l + return ret + +register.filter("make_li", make_li)