Opened 9 years ago

Closed 9 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
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 9 years ago.
patch with documentation and tests

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by medhat

patch with documentation and tests

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 9 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 9 years ago by adrian

  • Resolution set to worksforme
  • Status changed from new to closed

Closing as worksforme for the reason Matt pointed out.

comment:5 Changed 9 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:6 Changed 9 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 9 years ago by adrian

  • Resolution set to wontfix
  • Status changed from reopened to closed

Remarking as wontfix, as it was before.

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