mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
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. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -803,7 +803,7 @@ False
|
||||
>>> f.is_valid()
|
||||
True
|
||||
>>> type(f.cleaned_data['file'])
|
||||
<class 'django.newforms.fields.UploadedFile'>
|
||||
<class 'django.core.files.uploadedfile.SimpleUploadedFile'>
|
||||
>>> instance = f.save()
|
||||
>>> instance.file
|
||||
u'...test1.txt'
|
||||
@@ -814,7 +814,7 @@ u'...test1.txt'
|
||||
>>> f.is_valid()
|
||||
True
|
||||
>>> type(f.cleaned_data['file'])
|
||||
<class 'django.newforms.fields.UploadedFile'>
|
||||
<class 'django.core.files.uploadedfile.SimpleUploadedFile'>
|
||||
>>> instance = f.save()
|
||||
>>> instance.file
|
||||
u'...test1.txt'
|
||||
@@ -906,7 +906,7 @@ u'...test3.txt'
|
||||
>>> f.is_valid()
|
||||
True
|
||||
>>> type(f.cleaned_data['image'])
|
||||
<class 'django.newforms.fields.UploadedFile'>
|
||||
<class 'django.core.files.uploadedfile.SimpleUploadedFile'>
|
||||
>>> instance = f.save()
|
||||
>>> instance.image
|
||||
u'...test.png'
|
||||
@@ -918,7 +918,7 @@ u'...test.png'
|
||||
>>> f.is_valid()
|
||||
True
|
||||
>>> type(f.cleaned_data['image'])
|
||||
<class 'django.newforms.fields.UploadedFile'>
|
||||
<class 'django.core.files.uploadedfile.SimpleUploadedFile'>
|
||||
>>> instance = f.save()
|
||||
>>> instance.image
|
||||
u'...test.png'
|
||||
|
||||
Reference in New Issue
Block a user