#12784: Template tag and filter decorator fix
------------------------------------+---------------------------------------
          Reporter:  jimhark        |         Owner:  nobody                    
   
            Status:  closed         |     Milestone:                            
   
         Component:  Documentation  |       Version:  1.1                       
   
        Resolution:  worksforme     |      Keywords:  Template tag filter 
decorator
             Stage:  Unreviewed     |     Has_patch:  0                         
   
        Needs_docs:  0              |   Needs_tests:  0                         
   
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by jimhark):

 Replying to [comment:1 kmtracey]:
 > I've not encountered any problem following the current docs, omitting
 parentheses. Therefore I believe the doc as it currently is is correct:
 parentheses are not required. What in the source gave you the impression
 that they are?

 Sorry then. Their must be something screwy in my configuration because
 after adding the parentheses the template system stopped crashing for us.
 I got the idea after looking at template/_init_.py in the Library.tag
 function which starts like this:


 {{{
     def tag(self, name=None, compile_function=None):
         if name == None and compile_function == None:
             # @register.tag()
             return self.tag_function
         elif name != None and compile_function == None:
             if(callable(name)):
                 # @register.tag
                 return self.tag_function(name)

 }}}

 I read the if and it gave me the idea to add the parens which got my
 system working. Now reading further I see in the elif clause if "name" is
 callable it should just work without the parens. I'll be more careful
 before opening an issue in the future. Also if I can track down exactly
 what's causing the weird behavior on my system I'll post it here as a
 cautionary tail for others who might run into the same problem.

 Thanks,

 Jim

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12784#comment:2>
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