#9139: NoReverseMatch error should provide more details about urlpattern tried
--------------------------------+-------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  nobody    
   Status:  new                 |   Milestone:            
Component:  Uncategorized       |     Version:  1.0       
 Keywords:                      |       Stage:  Unreviewed
Has_patch:  0                   |  
--------------------------------+-------------------------------------------
 If I incorrectly create two urlpatterns to the same function:


 {{{
 urlpatterns = patterns(
   (r'view/$', 'myproject.myapp.view.viewer'),
   (r'view/(.*)/(.*)', 'myproject.myapp.view.viewer'),
 }}}

 and then refer to the second one in the template:

 {{{
 <a href="{%url myproject.myapp.view.viewer 'showitem',12%}">
 }}}

 I get the following error:

 {{{
 NoReverseMatch: Reverse for 'myproject.myapp.view.viewer' with arguments
 '(u'showitem',12L)' and keyword arguments '{}' not found.
 }}}

 The problem is that this message isn't clear.  At the very least, it
 should include the regex of the urlpattern it tried and failed to reverse
 to.

 I took a stab at fixing this at the point the NoReverseMatch was
 generated, but the reverse_dict is keyed with functions and get_callable
 isn't returning the exact same function+address each time, so I can't
 retrieve urlpattern details at that point.

 Maybe an exception should be generated at the time you try to add a second
 unnamed urlpattern to the same function?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9139>
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