Opened 18 years ago
Closed 18 years ago
#3402 closed (wontfix)
Enable the 'stem' part of the matched URL to be passed to the view
Reported by: | medhat | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Design decision needed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Currently, when django is doing url matching, and it reaches a point where the urls.py file is including another urls.py, it will discard the part that was mathced so far, and then begin matching inside the included urls.py. This patch will enable passing that discarded part (here called stem) to the view that will be eventually called.
This will be useful in the case where one view is called by many url patterns from many urls.py files. It will enable the view to know where it was called from.
This patch is fully backwards compatible.
Attachments (1)
Change History (8)
by , 18 years ago
Attachment: | django_stem.patch added |
---|
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 18 years ago
You can already do this. For example:
(r'^(?P<section>news)/', include('myproject.apps.news.urls')),
Each view mapped to a URL in myproject.apps.news.urls
will receive a variable section
containing the string 'news
'.
In my humble opinion, I would suggest closing this ticket.
comment:3 by , 18 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Closing as worksforme for the reason Matt pointed out.
comment:4 by , 18 years ago
comment:5 by , 18 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
comment:6 by , 18 years ago
I reopened this, hoping to entice more discussion on the merits of this change. Some of the discussion is already in the google groups discussion mentioned in my comment of 1/31.
comment:7 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
Remarking as wontfix, as it was before.
patch with documentation and tests