![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | __repr__ |
def | __getitem__ |
def | __setitem__ |
def | __copy__ |
def | __deepcopy__ |
def | __getstate__ |
def | __setstate__ |
def | get |
def | getlist |
def | setlist |
def | setdefault |
def | setlistdefault |
def | appendlist |
def | items |
def | iteritems |
def | lists |
def | iterlists |
def | values |
def | itervalues |
def | copy |
def | update |
A subclass of dictionary customized to handle multiple values for the same key. >>> d = MultiValueDict({'name': ['Adrian', 'Simon'], 'position': ['Developer']}) >>> d['name'] 'Simon' >>> d.getlist('name') ['Adrian', 'Simon'] >>> d.get('lastname', 'nonexistent') 'nonexistent' >>> d.setlist('lastname', ['Holovaty', 'Willison']) This class exists to solve the irritating problem raised by cgi.parse_qs, which returns a list for every key, even though most Web forms submit single name-value pairs.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.__getitem__ | ( | self, | |
key | |||
) |
Returns the last data value for this key, or [] if it's an empty list; raises KeyError if not found.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.appendlist | ( | self, | |
key, | |||
value | |||
) |
Appends an item to the internal list associated with key.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.copy | ( | self | ) |
Returns a copy of this object.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.get | ( | self, | |
key, | |||
default = None |
|||
) |
Returns the last data value for the passed key. If key doesn't exist or value is an empty list, then default is returned.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.getlist | ( | self, | |
key | |||
) |
Returns the list of values for the passed key. If key doesn't exist, then an empty list is returned.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.items | ( | self | ) |
Returns a list of (key, value) pairs, where value is the last item in the list associated with the key.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.iteritems | ( | self | ) |
Yields (key, value) pairs, where value is the last item in the list associated with the key.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.iterlists | ( | self | ) |
Yields (key, list) pairs.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.itervalues | ( | self | ) |
Yield the last value on every key list.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.lists | ( | self | ) |
Returns a list of (key, list) pairs.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.update | ( | self, | |
args, | |||
kwargs | |||
) |
update() extends rather than replaces existing key lists. Also accepts keyword args.
def google.appengine._internal.django.utils.datastructures.MultiValueDict.values | ( | self | ) |
Returns a list of the last value on every key list.