From d17bc72880caea967ee1f4332941269837b68a2a Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 30 Oct 2011 07:32:21 +0000 Subject: Fixed #17135 -- Made it possible to use decorators (like stringfilter) on template filter functions in combination with auto-escaping. Refs #16726. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17056 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/templates/templatetags/custom.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/regressiontests') diff --git a/tests/regressiontests/templates/templatetags/custom.py b/tests/regressiontests/templates/templatetags/custom.py index 86206617b8..7f788311c6 100644 --- a/tests/regressiontests/templates/templatetags/custom.py +++ b/tests/regressiontests/templates/templatetags/custom.py @@ -6,11 +6,10 @@ from django.template.loader import get_template register = template.Library() +@register.filter +@stringfilter def trim(value, num): return value[:num] -trim = stringfilter(trim) - -register.filter(trim) @register.simple_tag def no_params(): @@ -303,4 +302,4 @@ assignment_unlimited_args_kwargs.anything = "Expected assignment_unlimited_args_ def assignment_tag_without_context_parameter(arg): """Expected assignment_tag_without_context_parameter __doc__""" return "Expected result" -assignment_tag_without_context_parameter.anything = "Expected assignment_tag_without_context_parameter __dict__" \ No newline at end of file +assignment_tag_without_context_parameter.anything = "Expected assignment_tag_without_context_parameter __dict__" -- cgit v1.3