Re: [Django] #15138: Error in documentation simple_tag decorator.

2011-01-21 Thread Django
#15138: Error in documentation simple_tag decorator.
+---
  Reporter:  elbarto| Owner:  elbarto
Status:  new| Milestone: 
 Component:  Documentation  |   Version: 
Resolution: |  Keywords: 
 Stage:  Accepted   | Has_patch:  1  
Needs_docs:  0  |   Needs_tests:  0  
Needs_better_patch:  1  |  
+---
Changes (by russellm):

  * needs_better_patch:  => 1
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Accepted that the example is at least slightly ambiguous; however, the
 ambiguity should be fixed by using the argument, not by removing it. The
 point of the example is to demonstrate that "context" must be the first
 argument, not to say that you can't have other arguments.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15138: Error in documentation simple_tag decorator.

2011-01-20 Thread Django
#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: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.