mirror of
https://github.com/django/django.git
synced 2024-12-23 09:36:06 +00:00
Fixed #4726 -- Added a note about the exception raised by QuerySet.__getitem__.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6155 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
da0fef756c
commit
813c48e6eb
@ -183,6 +183,9 @@ subclass of dictionary. Exceptions are outlined here:
|
||||
|
||||
* ``__getitem__(key)`` -- Returns the value for the given key. If the key
|
||||
has more than one value, ``__getitem__()`` returns the last value.
|
||||
Raises ``django.utils.datastructure.MultiValueDictKeyError`` if the key
|
||||
does not exist (fortunately, this is a subclass of Python's standard
|
||||
``KeyError``, so you can stick to catching ``KeyError``).
|
||||
|
||||
* ``__setitem__(key, value)`` -- Sets the given key to ``[value]``
|
||||
(a Python list whose single element is ``value``). Note that this, as
|
||||
|
Loading…
Reference in New Issue
Block a user