Opened 6 hours ago
Last modified 4 hours ago
#36587 new Cleanup/optimization
Incorrect sentence in documentation about upload handlers — at Initial Version
Reported by: | Baptiste Mispelon | Owned by: | |
---|---|---|---|
Component: | Documentation | Version: | 5.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The documentation about changing upload handlers on the fly [1] states:
For instance, suppose you’ve written a ProgressBarUploadHandler that provides feedback on upload progress to some sort of AJAX widget. You’d add this handler to your upload handlers like this:
request.upload_handlers.insert(0, ProgressBarUploadHandler(request))
You’d probably want to uselist.insert()
in this case (instead ofappend()
) because a progress bar handler would need to run before any other handlers. Remember, the upload handlers are processed in order.
The part that says "You'd probably want to use list.insert [...] (instead of append)" is incorrect, since the example is already using list.insert
. The sentence should just say something like:
We use
list.insert
to make sure the progress bar handler is run before any other handlers, since the upload handlers are processed in order.