1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

[1.0.X] Fixed #8847, #10370: added some missing methods to MultiValueDict after [8399]. Thanks, James Turk and rfk. Backport of r10241 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jacob Kaplan-Moss
2009-03-31 22:02:37 +00:00
parent 4502a2d3ca
commit 4a3139d63e
3 changed files with 41 additions and 9 deletions

View File

@@ -45,6 +45,8 @@ MergeDict can merge MultiValueDicts
['Adrian', 'Simon']
>>> list(d.iteritems())
[('position', 'Developer'), ('name', 'Simon')]
>>> list(d.iterlists())
[('position', ['Developer']), ('name', ['Adrian', 'Simon'])]
>>> d['lastname']
Traceback (most recent call last):
...
@@ -58,6 +60,10 @@ MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
>>> d.getlist('lastname')
['Holovaty', 'Willison']
>>> d.values()
['Developer', 'Simon', 'Willison']
>>> list(d.itervalues())
['Developer', 'Simon', 'Willison']
### SortedDict #################################################################