Ticket #15138: simple_tag_doc.diff

File simple_tag_doc.diff, 967 bytes (added by elbarto, 4 years ago)

Included the arguments in the fictitious your_get_current_time_method().

  • docs/howto/custom-template-tags.txt

     
    669669    # The first argument *must* be called "context" here.
    670670    def current_time(context, format_string):
    671671        timezone = context['timezone']
    672         return your_get_current_time_method(timezone)
     672        return your_get_current_time_method(timezone, format_string)
    673673
    674674    register.simple_tag(takes_context=True)(current_time)
    675675
     
    678678    @register.simple_tag(takes_context=True)
    679679    def current_time(context, format_string):
    680680        timezone = context['timezone']
    681         return your_get_current_time_method(timezone)
     681        return your_get_current_time_method(timezone, format_string)
    682682
    683683For more information on how the ``takes_context`` option works, see the section
    684684on `inclusion tags`_.
Back to Top