Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19316 closed Cleanup/optimization (fixed)

Set args, kwargs & request before dispatch

Reported by: ghickman Owned by: nobody
Component: Generic views Version: dev
Severity: Normal Keywords:
Cc: mike@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

By moving the assignment of args, kwargs & request on self out of dispatch to the nested view method in as_view we can avoid the need for an additional hook to the CBV API while allowing easier overriding of dispatch. Anyone wishing to override dispatch with HTTP method agnostic code, such as permissions checks, can then rely on these variables being available on self.

Mailing list discussion: https://groups.google.com/forum/?fromgroups=#!topic/django-developers/7c7aI-slGNc

Pull Request: https://github.com/django/django/pull/532

Change History (4)

comment:1 by Mike Fogel, 12 years ago

Cc: mike@… added

comment:2 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by Claude Paroz <claude@…>, 12 years ago

Resolution: fixed
Status: newclosed

In ea6b95dbec77371d517392ffb465017b8eb7001c:

Fixed #19316 -- Set View args/kwargs/request before dispatch

comment:4 by Claude Paroz <claude@…>, 12 years ago

In 12cf9d2be3cccb2ff63d78e93f97188040488a3d:

[1.5.x] Fixed #19316 -- Set View args/kwargs/request before dispatch

Backport of ea6b95db from master.

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