Code

Ticket #15138: simple_tag_doc.diff

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

Included the arguments in the fictitious your_get_current_time_method().

Line 
1Index: docs/howto/custom-template-tags.txt
2===================================================================
3--- docs/howto/custom-template-tags.txt (revisión: 15268)
4+++ docs/howto/custom-template-tags.txt (copia de trabajo)
5@@ -669,7 +669,7 @@
6     # The first argument *must* be called "context" here.
7     def current_time(context, format_string):
8         timezone = context['timezone']
9-        return your_get_current_time_method(timezone)
10+        return your_get_current_time_method(timezone, format_string)
11 
12     register.simple_tag(takes_context=True)(current_time)
13 
14@@ -678,7 +678,7 @@
15     @register.simple_tag(takes_context=True)
16     def current_time(context, format_string):
17         timezone = context['timezone']
18-        return your_get_current_time_method(timezone)
19+        return your_get_current_time_method(timezone, format_string)
20 
21 For more information on how the ``takes_context`` option works, see the section
22 on `inclusion tags`_.