Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #15138 -- Clarified a slightly ambiguous example in the custom …

…template tag docs. Thanks to elbarto for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15448 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit f80e997c508cd4c218a5d0ac89018f1be908af85 1 parent 327d69d
Gabriel Hurley authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/howto/custom-template-tags.txt
View
4 docs/howto/custom-template-tags.txt
@@ -669,7 +669,7 @@ If your template tag needs to access the current context, you can use the
# The first argument *must* be called "context" here.
def current_time(context, format_string):
timezone = context['timezone']
- return your_get_current_time_method(timezone)
+ return your_get_current_time_method(timezone, format_string)
register.simple_tag(takes_context=True)(current_time)
@@ -678,7 +678,7 @@ Or, using decorator syntax::
@register.simple_tag(takes_context=True)
def current_time(context, format_string):
timezone = context['timezone']
- return your_get_current_time_method(timezone)
+ return your_get_current_time_method(timezone, format_string)
For more information on how the ``takes_context`` option works, see the section
on `inclusion tags`_.
Please sign in to comment.
Something went wrong with that request. Please try again.