Django

Code

Show
Ignore:
Timestamp:
07/01/08 10:10:51 (2 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/datastructures/tests.py

    r7744 r7814  
    118118['Adrian'] 
    119119 
    120 ### FileDict ################################################################ 
    121  
    122 >>> d = FileDict({'content': 'once upon a time...'}) 
     120### ImmutableList ################################################################ 
     121>>> d = ImmutableList(range(10)) 
     122>>> d.sort() 
     123Traceback (most recent call last): 
     124  File "<stdin>", line 1, in <module> 
     125  File "/var/lib/python-support/python2.5/django/utils/datastructures.py", line 359, in complain 
     126    raise AttributeError, self.warning 
     127AttributeError: ImmutableList object is immutable. 
    123128>>> repr(d) 
    124 "{'content': '<omitted>'}" 
    125 >>> d = FileDict({'other-key': 'once upon a time...'}) 
    126 >>> repr(d) 
    127 "{'other-key': 'once upon a time...'}" 
     129'(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)' 
     130>>> d = ImmutableList(range(10), warning="Object is immutable!") 
     131>>> d[1] 
     132
     133>>> d[1] = 'test' 
     134Traceback (most recent call last): 
     135  File "<stdin>", line 1, in <module> 
     136  File "/var/lib/python-support/python2.5/django/utils/datastructures.py", line 359, in complain 
     137    raise AttributeError, self.warning 
     138AttributeError: Object is immutable! 
    128139 
    129140### DictWrapper #############################################################