diff options
author | eliott <eliott@cactuswax.net> | 2007-12-29 15:07:19 -0800 |
---|---|---|
committer | eliott <eliott@cactuswax.net> | 2007-12-29 15:07:19 -0800 |
commit | c1063478aa989685b300c383580fc4ffc8b89f27 (patch) | |
tree | 1b04ff152d3e2d3bd261e4a797e5862c1eb30f70 /public/templatetags | |
parent | 28bc93261ef027d5c175de3d87c15b818543e151 (diff) |
Moved common to public
Diffstat (limited to 'public/templatetags')
-rw-r--r-- | public/templatetags/__init__.py | 0 | ||||
-rw-r--r-- | public/templatetags/validation.py | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/public/templatetags/__init__.py b/public/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/public/templatetags/__init__.py diff --git a/public/templatetags/validation.py b/public/templatetags/validation.py new file mode 100644 index 00000000..40c48da9 --- /dev/null +++ b/public/templatetags/validation.py @@ -0,0 +1,12 @@ +from django import template + +register = template.Library() + +@register.inclusion_tag('errors.html') +def print_errors(errors): + errs = [] + for e,msg in errors.iteritems(): + errmsg = str(msg[0]) + # hack -- I'm a python idiot + errs.append( (e, errmsg[2:-2]) ) + return {'errors': errs} |