﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9139	reverse() not finding correct match with some multiple patterns.	samt@…	Malcolm Tredinnick	"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?"		closed	Core (Other)	1.0		fixed			Accepted	0	0	0	0	0	0
