#11712: First use of reverse() freezes its cache
-------------------------------------+--------------------------------------
          Reporter:  [email protected]   |         Owner:  nobody               
            Status:  reopened        |     Milestone:                       
         Component:  Core framework  |       Version:  1.1                  
        Resolution:                  |      Keywords:  urlresolvers, reverse
             Stage:  Accepted        |     Has_patch:  0                    
        Needs_docs:  1               |   Needs_tests:  0                    
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Changes (by gmandx):

  * needs_docs:  0 => 1

Comment:

 Also, seems logical to use
 {{{
 class HomeFeed(Feed)
     # ...
     link = reverse('home_url')
     # ...
 }}}
 But, since the feed is an instance created '''during''' URLConf init,
 reverse() won't work. Instead, a link() method must be used, so reverse()
 is called at feed generation, not when the feed instance is created, like
 this:
 {{{
 class HomeFeed(Feed)
     # ...
     def link(self):
         return reverse('home_url')
     # ...
 }}}
 I've file another ticket (#13501) that is a duplicated of this one,
 because, as Beuc says, this should be well documented, since no errors are
 thrown. It took me 2 days to figure out the problem.

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