#15138: Error in documentation simple_tag decorator.
---------------------------+------------------------------------------------
 Reporter:  elbarto        |       Owner:  elbarto   
   Status:  new            |   Milestone:            
Component:  Documentation  |     Version:            
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  1              |  
---------------------------+------------------------------------------------
 In http://docs.djangoproject.com/en/dev/howto/custom-template-tags
 /#shortcut-for-simple-tags :

 The new examples, that use takes_context argument, have a second argument
 (format_string) which are never used.


 {{{
 # The first argument *must* be called "context" here.
 def current_time(context, format_string):
     timezone = context['timezone']
     return your_get_current_time_method(timezone)

 register.simple_tag(takes_context=True)(current_time)
 }}}

 {{{
 @register.simple_tag(takes_context=True)
 def current_time(context, format_string):
     timezone = context['timezone']
     return your_get_current_time_method(timezone)
 }}}

 I fixed it with a patch.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15138>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to