summaryrefslogtreecommitdiffstats
path: root/devel/templatetags/validation.py
blob: 38a40531b747dffdc0c90ca93b8dc950e87112aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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}

# vim: set ts=4 sw=4 et: