Code

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#19316 closed Cleanup/optimization (fixed)

Set args, kwargs & request before dispatch

Reported by: ghickman Owned by: nobody
Component: Generic views Version: master
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

Attachments (0)

Change History (4)

comment:1 Changed 17 months ago by carbonXT

  • Cc mike@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 17 months ago by claudep

  • Triage Stage changed from Unreviewed to Ready for checkin

comment:3 Changed 17 months ago by Claude Paroz <claude@…>

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

In ea6b95dbec77371d517392ffb465017b8eb7001c:

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

comment:4 Changed 17 months ago by Claude Paroz <claude@…>

In 12cf9d2be3cccb2ff63d78e93f97188040488a3d:

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

Backport of ea6b95db from master.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.