mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #2070: refactored Django's file upload capabilities.
A description of the new features can be found in the new [http://www.djangoproject.com/documentation/upload_handing/ 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. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -117,14 +117,25 @@ Init from sequence of tuples
|
||||
>>> d['person']['2']['firstname']
|
||||
['Adrian']
|
||||
|
||||
### FileDict ################################################################
|
||||
|
||||
>>> d = FileDict({'content': 'once upon a time...'})
|
||||
### ImmutableList ################################################################
|
||||
>>> d = ImmutableList(range(10))
|
||||
>>> d.sort()
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
||||
File "/var/lib/python-support/python2.5/django/utils/datastructures.py", line 359, in complain
|
||||
raise AttributeError, self.warning
|
||||
AttributeError: ImmutableList object is immutable.
|
||||
>>> repr(d)
|
||||
"{'content': '<omitted>'}"
|
||||
>>> d = FileDict({'other-key': 'once upon a time...'})
|
||||
>>> repr(d)
|
||||
"{'other-key': 'once upon a time...'}"
|
||||
'(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)'
|
||||
>>> d = ImmutableList(range(10), warning="Object is immutable!")
|
||||
>>> d[1]
|
||||
1
|
||||
>>> d[1] = 'test'
|
||||
Traceback (most recent call last):
|
||||
File "<stdin>", line 1, in <module>
|
||||
File "/var/lib/python-support/python2.5/django/utils/datastructures.py", line 359, in complain
|
||||
raise AttributeError, self.warning
|
||||
AttributeError: Object is immutable!
|
||||
|
||||
### DictWrapper #############################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user