Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#33172 closed Cleanup/optimization (fixed)

Document CBV decoration for modifying upload handlers on the fly

Reported by: Matthew Pava Owned by: SREEHARI K.V
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

In this documentation, there is a very important and helpful note in modifying upload handlers on the fly. However, it only covers how to decorate the view when it is a function. It does not cover how to decorate the view when it is a class. There are StackOverflow questions that answer that, but it requires some digging. I would greatly appreciate anyone to add guidance on how to change file upload handlers in a class-based view.

https://docs.djangoproject.com/en/dev/topics/http/file-uploads/#modifying-upload-handlers-on-the-fly

Change History (8)

comment:1 by Matthew Pava, 3 years ago

Summary: Document CBV decoration for FIleUploadHandlerDocument CBV decoration for modifying upload handlers on the fly

comment:2 by Keryn Knight, 3 years ago

Triage Stage: UnreviewedAccepted

Accepting on the basis that using CBVs is probably the most prevalent form these days, and I genuinely wouldn't know which bits of the CBV to decorate with what. I'd guess method_decorator would be necessary too.

Some documentation indicating the correct path would not be amiss -- most of that section hasn't been touched since 2010 or earlier, predating CBVs.

comment:3 by Nick Frazier, 3 years ago

Owner: changed from nobody to Nick Frazier
Status: newassigned

comment:4 by Mariusz Felisiak, 3 years ago

Has patch: set
Owner: changed from Nick Frazier to SREEHARI K.V

comment:5 by Mariusz Felisiak, 3 years ago

Patch needs improvement: set

comment:6 by Mariusz Felisiak, 3 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:7 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In e2f778d5:

Fixed #33172 -- Added example of modifying upload handlers on the fly for CBVs.

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In c067a2b:

[4.0.x] Fixed #33172 -- Added example of modifying upload handlers on the fly for CBVs.

Backport of e2f778d57947d168a875159e6df075255eea4bbc from main

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