1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #12847 -- Added name parameter to simple_tag, assignment_tag and inclusion_tag helpers. Thanks, vladmos.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16373 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-06-11 16:05:28 +00:00
parent 4970ef07c2
commit d27f909d2e
5 changed files with 33 additions and 8 deletions

View File

@@ -687,6 +687,16 @@ Or, using decorator syntax::
For more information on how the ``takes_context`` option works, see the section
on :ref:`inclusion tags<howto-custom-template-tags-inclusion-tags>`.
.. versionadded:: 1.4
If you need to rename your tag, you can provide a custom name for it::
register.simple_tags(lambda x: x - 1, name='minusone')
@register.simple_tag(name='minustwo')
def some_function(value):
return value - 1
.. _howto-custom-template-tags-assignment-tags:
Assignment tags