mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
queryset-refactor: Merged from trunk up to [6724].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -25,11 +25,23 @@
|
||||
>>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']})
|
||||
>>> d['name']
|
||||
'Simon'
|
||||
>>> d.get('name')
|
||||
'Simon'
|
||||
>>> d.getlist('name')
|
||||
['Adrian', 'Simon']
|
||||
>>> d['lastname']
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
MultiValueDictKeyError: "Key 'lastname' not found in <MultiValueDict: {'position': ['Developer'], 'name': ['Adrian', 'Simon']}>"
|
||||
>>> d.get('lastname')
|
||||
|
||||
>>> d.get('lastname', 'nonexistent')
|
||||
'nonexistent'
|
||||
>>> d.getlist('lastname')
|
||||
[]
|
||||
>>> d.setlist('lastname', ['Holovaty', 'Willison'])
|
||||
>>> d.getlist('lastname')
|
||||
['Holovaty', 'Willison']
|
||||
|
||||
### SortedDict #################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user