Save ResolverMatch in HttpRequest
|Reported by:||nischu7||Owned by:||nobody|
|Cc:||real.human@…||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||yes|
|Needs tests:||yes||Patch needs improvement:||no|
In order to simplify the implementation of navigation systems within templates, the HttpRequest instance passed around in the request cycle should held a "url_name" property.
You define a url that looks like this one:
url(r'^$', 'core.views.dashboard', name='dashboard'),
You'll be able to get the name by accessing "request.url_name". This is more efficient than having to re-resolve the URL in the views/middleware classes/template tag implementations etc.
Change History (15)
comment:5 Changed 6 years ago by
|Triage Stage:||Unreviewed → Design decision needed|
comment:9 Changed 4 years ago by
|Summary:||Add "url_name" to HttpRequest → Save ResolverMatch in HttpRequest|