Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#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)

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

Download all attachments as: .zip

Change History (12)

by Michael Axiak, 16 years ago

Attachment: initial_patch.diff added

Initial patch, with doc and test changes.

by Michael Axiak, 16 years ago

Attachment: second_patch.diff added

Second patch...

by Michael Axiak, 16 years ago

Attachment: third_patch.diff added

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

by Michael Axiak, 16 years ago

Attachment: fourth_patch.diff added

More removal of file_name

by Michael Axiak, 16 years ago

Attachment: 7814_cleanups.2.diff added

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

by Michael Axiak, 16 years ago

Attachment: 7814_cleanups.diff added

Update to the patch...thanks vomjom!

comment:1 by Jacob, 16 years ago

This patch will also fix #7593.

comment:2 by Michael Axiak, 16 years ago

Cc: vomjom@… added

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

comment:3 by Jacob, 16 years ago

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 by Jacob, 16 years ago

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

comment:5 by Jacob, 16 years ago

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

comment:6 by Jacob, 12 years ago

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

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