{{{
class FileUploadHandler:
# ...
def variable_complete(self, variable_name, variable_value):
"""
Called after a POST variable has been successfully parsed from the
multipart request.
"""
pass
}}}
This would save me the trouble of manually having to parse the multipart
request myself in "handle_raw_input".
--
Ticket URL: <https://code.djangoproject.com/ticket/20034>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Pull request with patch here: https://github.com/django/django/pull/898
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:1>
Comment (by rfkrocktk@…):
Here's a workaround I came up with by adapting the Django code in a custom
handler: http://stackoverflow.com/a/15377990/128967
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:2>
* has_patch: 0 => 1
* type: Uncategorized => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:3>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:4>
* component: Core (Other) => HTTP handling
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:5>
* needs_docs: 0 => 1
* needs_tests: 0 => 1
Comment:
Patch looks okay, but needs tests and documentation.
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:6>
* owner: nobody => tadeck
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:7>
* needs_docs: 1 => 0
* version: 1.5 => master
* needs_tests: 1 => 0
Comment:
Ready for review.
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:8>
* stage: Accepted => Ready for checkin
Comment:
I went thru https://github.com/django/django/pull/1148 and to me it looks
nice.
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:9>
* status: assigned => new
* cc: tadeck (added)
* owner: tadeck =>
* easy: 1 => 0
Comment:
(deassigned, waiting for someone to merge pull request)
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:10>
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
Patch needs to be updated to apply cleanly to master and reflect the fact
that it would go in 1.7 instead of 1.6. It should also be listed as a
minor feature in the release notes. Finally, it would be helpful to
include some explanation in the documentation of why this hook would be
used. It's not clear from the ticket what the use case for this is which
is why I think it was stuck in "RFC" status for so long. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:11>
Comment (by rfkrocktk@…):
The use case is a special one, but it's still relevant to certain people.
In multipart uploads, if a certain field has an incorrect value, it may be
of some use to stop the entire file transfer before the data is
transferred. For example, given this upload:
Field: authentication-ticket
Value: 1021012021012012
-------------------------
Field: filedata
Value: <binary data>
If the authentication-ticket field was wrong, why transfer a 3.0GB file
across the wire? You're wasting bandwidth, disk I/O, and more importantly,
client time if you have to wait for 3.0GB to transfer before seeing that
you have an incorrect value.
--
Ticket URL: <https://code.djangoproject.com/ticket/20034#comment:12>