﻿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
16406	Allow separate access to matches from urlpatterns and extra_context args	Florian Apolloner	Alokik Roy	"Currently Django's ''!ResolverMatch'' (eg the one returned by ''urlresolvers.resolve'') gives access to ''args'' and ''kwargs'' which are ready to be passed to the ''func'' being resolved. This does eliminate the possibility of an interesting use-case:

Let's assume I have a page written in english and german. I configured my urls using the new urlpatterns like this:
{{{#!python
urlpatterns = i18n_patterns('',
    url(_(r'^about/$'), 'about.view', {'some_extra': 'data'}, name='about'),
    url(_(r'^news/$'), 'home.view', {'some_extra': 'data'}, name='home'),
)
}}}

I now would like to give my visitors an easy way to access the content in german. So my ''/about'' should have a link to ''/über''. To do that, one could write a templatetag which does the following:

{{{#!python
match = urlresolvers.resolve('current-url')
links = []
for lang in settings.LANGUAGES:
  translation.activate(lang):
  links.append(reverse(match.url_name, args=match.args, kwargs=match.kwargs))
# Further logic to display the links in the template
}}}

This doesn't work since the ''!ResolverMatch'' combined the ''kwargs'' captured from the url-regex with the dictionary supplied for the extra data.

I think it would be a great if the ''!ResolverMatch'' would give access to ''kwargs'' and ''extra_context'' separately. There might be more usecases, but that's the only one I can come up with for now. From a quick view at the code it should be possible to do that backwards-compat (eg ''!ResolverMatch.!__getitem!__'' would still return the current result but internally it would use two dictionaries)."	Cleanup/optimization	closed	Core (URLs)	dev	Normal	fixed	resolvers, reverse	Alexandre Prieto Pantoja Alokik Roy	Ready for checkin	1	0	0	0	1	0
