diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-06-11 16:05:28 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-06-11 16:05:28 +0000 |
| commit | d27f909d2e8e215dc9c52d090cee393a719a7965 (patch) | |
| tree | 479786711eb36bf5778d4e9aa95d678fc1b0dcee /docs | |
| parent | 4970ef07c2f6e33da26232703e542b926a1fd2e7 (diff) | |
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
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/custom-template-tags.txt | 10 | ||||
| -rw-r--r-- | docs/releases/1.4.txt | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/howto/custom-template-tags.txt b/docs/howto/custom-template-tags.txt index 1b56cf85c3..97f1e9a53b 100644 --- a/docs/howto/custom-template-tags.txt +++ b/docs/howto/custom-template-tags.txt @@ -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 diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt index 0fbcd34d77..65f3dfe050 100644 --- a/docs/releases/1.4.txt +++ b/docs/releases/1.4.txt @@ -175,6 +175,7 @@ Django 1.4 also includes several smaller improvements worth noting: code are slightly emphasized. This change makes it easier to scan a stacktrace for issues in user code. +* Customizable names for :meth:`~django.template.Library.simple_tag`. .. _backwards-incompatible-changes-1.4: |
