Django

Code

Show
Ignore:
Timestamp:
07/01/08 10:10:51 (6 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/forms/error_messages.py

    r7776 r7814  
    22tests = r""" 
    33>>> from django.newforms import * 
     4>>> from django.core.files.uploadedfile import SimpleUploadedFile 
    45 
    56# CharField ################################################################### 
     
    215216... 
    216217ValidationError: [u'INVALID'] 
    217 >>> f.clean({}
    218 Traceback (most recent call last): 
    219 ... 
    220 ValidationError: [u'MISSING'] 
    221 >>> f.clean({'filename': 'name', 'content':''}
     218>>> f.clean(SimpleUploadedFile('name', None)
     219Traceback (most recent call last): 
     220... 
     221ValidationError: [u'EMPTY FILE'] 
     222>>> f.clean(SimpleUploadedFile('name', '')
    222223Traceback (most recent call last): 
    223224...