Opened 10 years ago

Closed 10 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: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Currently, when django is doing url matching, and it reaches a point where the file is including another, it will discard the part that was mathced so far, and then begin matching inside the included 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 files. It will enable the view to know where it was called from.

This patch is fully backwards compatible.

Attachments (1)

django_stem.patch (11.5 KB) - added by medhat 10 years ago.
patch with documentation and tests

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by medhat

Attachment: django_stem.patch added

patch with documentation and tests

comment:1 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 10 years ago by Matt

You can already do this. For example:

(r'^(?P<section>news)/', include('')),

Each view mapped to a URL in will receive a variable section containing the string 'news'.

In my humble opinion, I would suggest closing this ticket.

comment:3 Changed 10 years ago by Adrian Holovaty

Resolution: worksforme
Status: newclosed

Closing as worksforme for the reason Matt pointed out.

comment:5 Changed 10 years ago by anonymous

Resolution: worksforme
Status: closedreopened

comment:6 Changed 10 years ago by medhat

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 Changed 10 years ago by Adrian Holovaty

Resolution: wontfix
Status: reopenedclosed

Remarking as wontfix, as it was before.

Note: See TracTickets for help on using tickets.
Back to Top