#7614 closed (fixed)
There should be only one UploadedFile
Reported by: | Michael Axiak | Owned by: | Michael Axiak |
---|---|---|---|
Component: | HTTP handling | Version: | dev |
Severity: | Keywords: | 2070, upload handling | |
Cc: | vomjom@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Since #2070 was merged, there have been two UploadedFile classes and newforms copied extra data around needlessly.
This aims to fix this, with the only issue being that it's slightly backwards incompatible, since form.cleaned_data['field_name'].filename
would now be form.cleaned_data['field_name'].file_name
and the semantics form.cleaned_data['field_name'].data
change to behave the same as the new UploadedFile.
Attachments (6)
Change History (12)
by , 16 years ago
Attachment: | initial_patch.diff added |
---|
by , 16 years ago
Attachment: | third_patch.diff added |
---|
This patch has backwards "compatible" interfaces for people to use.
by , 16 years ago
Attachment: | 7814_cleanups.2.diff added |
---|
Overall cleanups for r7814...addressing all API changes that I know of.
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [7859]) Fixed #7614: the quickening has come, and there now is only one UploadedFile. On top of that, UploadedFile's interface has been improved:
- The API now more closely matches a proper file API. This unfortunately means a few backwards-incompatible renamings; see BackwardsIncompatibleChanges. This refs #7593.
- While we were at it, renamed chunk() to chunks() to clarify that it's an iterator.
- Temporary uploaded files now property use the tempfile library behind the scenes which should ensure better cleanup of tempfiles (refs #7593 again).
Thanks to Mike Axiak for the bulk of this patch.
Initial patch, with doc and test changes.