Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#7614 closed (fixed)

There should be only one UploadedFile

Reported by: Michael Axiak Owned by: Michael Axiak
Component: HTTP handling Version: master
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: UI/UX:

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)

initial_patch.diff (6.2 KB) - added by Michael Axiak 8 years ago.
Initial patch, with doc and test changes.
second_patch.diff (6.8 KB) - added by Michael Axiak 8 years ago.
Second patch…
third_patch.diff (10.8 KB) - added by Michael Axiak 8 years ago.
This patch has backwards "compatible" interfaces for people to use.
fourth_patch.diff (11.2 KB) - added by Michael Axiak 8 years ago.
More removal of file_name
7814_cleanups.2.diff (25.0 KB) - added by Michael Axiak 8 years ago.
Overall cleanups for r7814...addressing all API changes that I know of.
7814_cleanups.diff (25.5 KB) - added by Michael Axiak 8 years ago.
Update to the patch...thanks vomjom!

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by Michael Axiak

Attachment: initial_patch.diff added

Initial patch, with doc and test changes.

Changed 8 years ago by Michael Axiak

Attachment: second_patch.diff added

Second patch...

Changed 8 years ago by Michael Axiak

Attachment: third_patch.diff added

This patch has backwards "compatible" interfaces for people to use.

Changed 8 years ago by Michael Axiak

Attachment: fourth_patch.diff added

More removal of file_name

Changed 8 years ago by Michael Axiak

Attachment: 7814_cleanups.2.diff added

Overall cleanups for r7814...addressing all API changes that I know of.

Changed 8 years ago by Michael Axiak

Attachment: 7814_cleanups.diff added

Update to the patch...thanks vomjom!

comment:1 Changed 8 years ago by Jacob

This patch will also fix #7593.

comment:2 Changed 8 years ago by Michael Axiak

Cc: vomjom@… added

We're now using this ticket to track changes for #7593.

comment:3 Changed 8 years ago by Jacob

Resolution: fixed
Status: newclosed

(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.

comment:4 Changed 8 years ago by Jacob

(In [7860]) Added a missing deprecated property (UploadedFile.filename) from [7859]. Refs #7614.

comment:5 Changed 8 years ago by Jacob

(In [7861]) Fixed deprecated UploadedFile.data attribute. Refs #7614.

comment:6 Changed 5 years ago by Jacob

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

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