Django

Code

Ticket #7614 (closed: fixed)

Opened 2 months ago

Last modified 2 months ago

There should be only one UploadedFile

Reported by: axiak Assigned to: axiak
Milestone: 1.0 alpha Component: HTTP handling
Version: SVN Keywords: 2070, upload handling
Cc: vomjom@gmail.com Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

initial_patch.diff (6.2 kB) - added by axiak on 07/02/08 17:40:52.
Initial patch, with doc and test changes.
second_patch.diff (6.8 kB) - added by axiak on 07/02/08 18:15:39.
Second patch…
third_patch.diff (10.8 kB) - added by axiak on 07/03/08 11:06:30.
This patch has backwards "compatible" interfaces for people to use.
fourth_patch.diff (11.2 kB) - added by axiak on 07/03/08 11:18:48.
More removal of file_name
7814_cleanups.2.diff (25.0 kB) - added by axiak on 07/03/08 16:32:35.
Overall cleanups for r7814...addressing all API changes that I know of.
7814_cleanups.diff (25.5 kB) - added by axiak on 07/07/08 17:22:58.
Update to the patch...thanks vomjom!

Change History

07/02/08 17:40:52 changed by axiak

  • attachment initial_patch.diff added.

Initial patch, with doc and test changes.

07/02/08 18:15:39 changed by axiak

  • attachment second_patch.diff added.

Second patch...

07/03/08 11:06:30 changed by axiak

  • attachment third_patch.diff added.

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

07/03/08 11:18:48 changed by axiak

  • attachment fourth_patch.diff added.

More removal of file_name

07/03/08 16:32:35 changed by axiak

  • attachment 7814_cleanups.2.diff added.

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

07/07/08 17:22:58 changed by axiak

  • attachment 7814_cleanups.diff added.

Update to the patch...thanks vomjom!

07/07/08 17:34:06 changed by jacob

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

This patch will also fix #7593.

07/07/08 17:35:39 changed by axiak

  • cc set to vomjom@gmail.com.

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

07/07/08 18:16:01 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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

07/07/08 18:36:35 changed by jacob

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

07/07/08 18:36:45 changed by jacob

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


Add/Change #7614 (There should be only one UploadedFile)




Change Properties
Action