#5971: django.template.TokenParser inconsistent with parsing filters
-------------------------------------------------------+--------------------
   Reporter:  Dmitri Fedortchenko <[EMAIL PROTECTED]>  |                Owner:  
nobody         
     Status:  new                                      |            Component:  
Template system
    Version:  SVN                                      |           Resolution:  
               
   Keywords:  template filter                          |                Stage:  
Unreviewed     
  Has_patch:  1                                        |           Needs_docs:  
0              
Needs_tests:  0                                        |   Needs_better_patch:  
0              
-------------------------------------------------------+--------------------
Changes (by Dmitri Fedortchenko <[EMAIL PROTECTED]>):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 django.template.TokenParser is inconsistent when parsing filters that
 follow constant strings or variables.

 Meaning that {% tag thevar|filter sometag %} will produce:
 {{{
 self.value() = "thevar|filter"
 self.tag() = "sometag"
 }}}
 However {% tag "a value"|filter sometag %} will produce:
 {{{
 self.value() = "a value"
 self.tag() = "|filter"
 self.tag() = "sometag"
 }}}

 This does not seem like correct behaviour... I made a very simple patch
 for this, thus the outcome of the above:

 {{{
 {% tag "a value"|filter sometag %} will produce:
 self.value() = "a value"|filter
 self.tag() = sometag
 }}}

 So now we can simply pass the "value" into a FilterExpression? to parse
 the filters...

 See this thread:
 http://groups.google.com/group/django-
 developers/browse_thread/thread/c90b6e29d20724ca

 PS: I should learn to use the preview button.
 PPS: The __self__ is from the perspective of the implementee of the
 TokenParser class.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5971#comment:1>
Django Code <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