Opened 4 weeks ago

Closed 2 weeks ago

#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, 4 weeks ago

Triage Stage: UnreviewedAccepted

Seems reasonable, yes.

comment:2 by Sarah Boyce, 4 weeks ago

Component: DocumentationGeneric views
Summary: Add what .setup()` does to a view to the documentationDocument 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, 4 weeks ago

Has patch: set
Owner: set to Chaitanya Rahalkar
Status: newassigned

comment:4 by Chaitanya Rahalkar, 4 weeks 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, 4 weeks ago

Patch needs improvement: set

comment:6 by Jacob Walls, 3 weeks ago

Patch needs improvement: unset

comment:7 by Sarah Boyce, 2 weeks ago

Patch needs improvement: set

comment:8 by Sarah Boyce, 2 weeks ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:9 by Sarah Boyce <42296566+sarahboyce@…>, 2 weeks ago

Resolution: fixed
Status: assignedclosed

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