From 6947a6df3d0078c4b86fcb7467af610ecba314df Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Sat, 11 Oct 2008 20:00:55 -0400 Subject: drop some unused templatetags --- packages/templatetags/package_extras.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'packages') diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index b6868ec..38c92c2 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -6,8 +6,8 @@ register = template.Library() class BuildQueryStringNode(template.Node): def __init__(self, sortfield): self.sortfield = sortfield + def render(self, context): - #qs = context['querystring'].copy() qs = dict(cgi.parse_qsl(context['current_query'][1:])) if qs.has_key('sort') and qs['sort'] == self.sortfield: if self.sortfield.startswith('-'): @@ -23,27 +23,14 @@ def do_buildsortqs(parser, token): try: tagname, sortfield = token.split_contents() except ValueError: - raise template.TemplateSyntaxError, "%r tag requires a single argument" % tagname + raise template.TemplateSyntaxError( + "%r tag requires a single argument" % tagname) if not (sortfield[0] == sortfield[-1] and sortfield[0] in ('"', "'")): - raise template.TemplateSyntaxError, "%r tag's argument should be in quotes" % tagname + raise template.TemplateSyntaxError( + "%r tag's argument should be in quotes" % tagname) return BuildQueryStringNode(sortfield[1:-1]) -@register.filter(name='space2br') -def space2br(value): - return value.replace(' ', '
') - @register.inclusion_tag('forms/td_input.html') def td_input(form_element): return {'form_element': form_element} -@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: - -- cgit v1.2.3-24-g4f1b