Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7614 closed (fixed)

There should be only one UploadedFile

Reported by: axiak Owned by: 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 axiak 6 years ago.
Initial patch, with doc and test changes.
second_patch.diff (6.8 KB) - added by axiak 6 years ago.
Second patch…
third_patch.diff (10.8 KB) - added by axiak 6 years ago.
This patch has backwards "compatible" interfaces for people to use.
fourth_patch.diff (11.2 KB) - added by axiak 6 years ago.
More removal of file_name
7814_cleanups.2.diff (25.0 KB) - added by axiak 6 years ago.
Overall cleanups for r7814...addressing all API changes that I know of.
7814_cleanups.diff (25.5 KB) - added by axiak 6 years ago.
Update to the patch...thanks vomjom!

Download all attachments as: .zip

Change History (12)

Changed 6 years ago by axiak

Initial patch, with doc and test changes.

Changed 6 years ago by axiak

Second patch...

Changed 6 years ago by axiak

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

Changed 6 years ago by axiak

More removal of file_name

Changed 6 years ago by axiak

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

Changed 6 years ago by axiak

Update to the patch...thanks vomjom!

comment:1 Changed 6 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This patch will also fix #7593.

comment:2 Changed 6 years ago by axiak

  • Cc vomjom@… added

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

comment:3 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to 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.

comment:4 Changed 6 years ago by jacob

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

comment:5 Changed 6 years ago by jacob

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

comment:6 Changed 3 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.