#36026 closed Cleanup/optimization (fixed)

Document that View.setup() sets attributes such as request, args, kwargs

Reported by: Willem Van Onsem Owned by: Chaitanya Rahalkar
Component: Generic views Version: 5.1
Severity: Normal Keywords:
Cc: 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

A ​question at StackOverflow asks where it is documented that self.kwargs is set, and although it is mentioned for example in the ​Built-in class-based generic views section, it does not appear in the documentation of the ​Base views nor in the documentation for the .setup(..) method.

Perhaps the documentation regarding base views should explain what setup is doing?

Change History (9)

comment:1 by Carlton Gibson, 22 months ago

Triage Stage: Unreviewed → Accepted

Seems reasonable, yes.

comment:2 by Sarah Boyce, 22 months ago

Component: Documentation → Generic views
Summary: Add what .setup()` does to a view to the documentation → Document that View.setup() sets attributes such as request, args, kwargs

I agree we could be clear in the docs here - would you like to prepare a patch?

comment:3 by Chaitanya Rahalkar, 22 months ago

Has patch: set
Owner: set to Chaitanya Rahalkar
Status: new → assigned

comment:4 by Chaitanya Rahalkar, 22 months ago

Added a PR for this - ​https://github.com/django/django/pull/18952

Let me know if the wording looks good! Thank you.

comment:5 by Sarah Boyce, 22 months ago

Patch needs improvement: set

comment:6 by Jacob Walls, 22 months ago

Patch needs improvement: unset

comment:7 by Sarah Boyce, 22 months ago

Patch needs improvement: set

comment:8 by Sarah Boyce, 22 months ago

Patch needs improvement: unset
Triage Stage: Accepted → Ready for checkin

comment:9 by Sarah Boyce <42296566+sarahboyce@…>, 22 months ago

Resolution: → fixed
Status: assigned → closed

In d97cacc2:

Fixed #36026 -- Clarified that View.setup() sets the request, args, kwargs attributes.

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