Django

Code

Show
Ignore:
Timestamp:
07/01/08 10:10:51 (3 months ago)
Author:
jacob
Message:

Fixed #2070: refactored Django's file upload capabilities.

A description of the new features can be found in the new upload handling documentation; the executive summary is that Django will now happily handle uploads of large files without issues.

This changes the representation of uploaded files from dictionaries to bona fide objects; see BackwardsIncompatibleChanges for details.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/regressiontests/bug639/tests.py

    r5876 r7814  
    1010from django.http import QueryDict 
    1111from django.utils.datastructures import MultiValueDict 
     12from django.core.files.uploadedfile import SimpleUploadedFile 
    1213 
    1314class Bug639Test(unittest.TestCase): 
     
    2223        # Fake a request query dict with the file 
    2324        qd = QueryDict("title=Testing&image=", mutable=True) 
    24         qd["image_file"] = { 
    25             "filename" : "test.jpg", 
    26             "content-type" : "image/jpeg", 
    27             "content" : img 
    28         } 
    29          
     25        qd["image_file"] = SimpleUploadedFile('test.jpg', img, 'image/jpeg') 
     26 
    3027        manip = Photo.AddManipulator() 
    3128        manip.do_html2python(qd)