From 39a548fd2629f3b6383990264b2e331b3aea99fb Mon Sep 17 00:00:00 2001 From: eliott Date: Sat, 3 Nov 2007 03:45:10 -0400 Subject: Initial import for public release... Special Note Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd! --- common/templatetags/validation.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 common/templatetags/validation.py (limited to 'common/templatetags/validation.py') diff --git a/common/templatetags/validation.py b/common/templatetags/validation.py new file mode 100644 index 0000000..40c48da --- /dev/null +++ b/common/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} -- cgit v1.2.3-24-g4f1b