diff options
author | eliott <eliott@cactuswax.net> | 2007-11-03 03:45:10 -0400 |
---|---|---|
committer | eliott <eliott@cactuswax.net> | 2007-11-03 03:45:10 -0400 |
commit | 39a548fd2629f3b6383990264b2e331b3aea99fb (patch) | |
tree | f68c3156dad5f7814473ceff2461679ddf11a2e8 /common/templatetags |
Initial import for public release...
Special Note
Prior to git import, approx 90% of the code was done by Judd Vinet. Thanks Judd!
Diffstat (limited to 'common/templatetags')
-rw-r--r-- | common/templatetags/__init__.py | 0 | ||||
-rw-r--r-- | common/templatetags/validation.py | 12 |
2 files changed, 12 insertions, 0 deletions
diff --git a/common/templatetags/__init__.py b/common/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/common/templatetags/__init__.py diff --git a/common/templatetags/validation.py b/common/templatetags/validation.py new file mode 100644 index 00000000..40c48da9 --- /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} |