Ticket #15138: inclusion_tag_doc.diff
File inclusion_tag_doc.diff, 816 bytes (added by , 14 years ago) |
---|
-
docs/howto/custom-template-tags.txt
667 667 ``takes_context`` argument when registering your tag:: 668 668 669 669 # The first argument *must* be called "context" here. 670 def current_time(context , format_string):670 def current_time(context): 671 671 timezone = context['timezone'] 672 672 return your_get_current_time_method(timezone) 673 673 … … 676 676 Or, using decorator syntax:: 677 677 678 678 @register.simple_tag(takes_context=True) 679 def current_time(context , format_string):679 def current_time(context): 680 680 timezone = context['timezone'] 681 681 return your_get_current_time_method(timezone) 682 682