Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#878 closed defect (fixed)

URLconf regexp captures should be passed as *args

Reported by: aaronsw Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Currently you have to write (?P<foo>) to get a capture out of a URL regular expression and into your function. Since this seems to be what you almost always want to do, why not just treat it like a normal regular expression and pass on every capture that doesn't start with ?:

Change History (4)

comment:1 Changed 11 years ago by hugo

url patterns aren't necessarily in the same order as function parameters. So *args is rather useless, as it would be a fixed, predefined order of elements in the url.

comment:2 Changed 11 years ago by hugo

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

Additioinally I think stuff like this should be just asked in the django-users list - this is more a "why is it that way" question than an actual "defect". It might be that because of a discussion on the list this will become an enhancement or defect - but for now it's just an enquiry and that's best done in either the IRC channel or the mailing lists.

comment:3 Changed 11 years ago by adrian

  • Resolution invalid deleted
  • Status changed from closed to reopened

This is an intriguing idea.

comment:4 Changed 11 years ago by adrian

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

(In [1470]) Fixed #878 -- URLconf regex captures no longer have to be named groups. Old URLconfs (with named groups) still work. This is backwards-incompatible if you've defined custom middleware with a process_view function. See

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