#24430: wildcard matching and reversing of URLs
-----------------------------+--------------------------------------
Reporter: eskhool | Owner: nobody
Type: New feature | Status: new
Component: Core (URLs) | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by timgraham):
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0
Old description:
> Example:
> urlpatterns += patterns('',
> (r'^\w+/', include(admin.site.urls),),
> )
>
> All links generated by the admin site with this url show a 'x'
> for example
> /x/<app_name>/<model_name>/
>
> instead of the result of the matching wild card 'ABC' from
> ABC/<app_name>/<model_name>
>
> the problem is that reverse can not know what to put in the wild card
> without having the path or the request as context.
>
> Solution: add an optional parameter to reverse which is the request and
> the reverse can happen with the context of the request which is found
> acceptable in case the request parameter is not none.
New description:
Example:
{{{
urlpatterns += patterns('',
(r'^\w+/', include(admin.site.urls),),
)
}}}
All links generated by the admin site with this url show a 'x'
for example : `/x/<app_name>/<model_name>/`
instead of the result of the matching wild card 'ABC' from
`ABC/<app_name>/<model_name>`
the problem is that reverse can not know what to put in the wild card
without having the path or the request as context.
Solution: add an optional parameter to reverse which is the request and
the reverse can happen with the context of the request which is found
acceptable in case the request parameter is not none.
--
Comment:
What's the use case for allowing the admin to be accessed at a wildcard
URL?
--
Ticket URL: <https://code.djangoproject.com/ticket/24430#comment:1>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/065.fbd7942d08bc06e5d8da4cc90616b870%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.