Package restkit :: Module datastructures :: Class MultiDict
[hide private]

Class MultiDict

source code

UserDict.DictMixin --+
                     |
                    MultiDict

An ordered dictionary that can have multiple values for each key. Adds the methods getall, getone, mixed and extend and add to the normal dictionary interface.

Instance Methods [hide private]
 
__init__(self, *args, **kw) source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
add(self, key, value)
Add the key and value, not overwriting any previous value.
source code
 
getall(self, key)
Return a list of all values matching the key (may be an empty list)
source code
 
iget(self, key)
like get but case insensitive
source code
 
getone(self, key)
Get one value matching the key, raising a KeyError if multiple values were found.
source code
 
mixed(self)
Returns a dictionary where the values are either single values, or a list of values when a key/value appears more than once in this dictionary.
source code
 
dict_of_lists(self)
Returns a dictionary where each key is associated with a list of values.
source code
 
__delitem__(self, key) source code
 
__contains__(self, key) source code
 
has_key(self, key) source code
 
clear(self) source code
 
copy(self) source code
 
setdefault(self, key, default=None) source code
 
pop(self, key, *args) source code
 
ipop(self, key, *args)
like pop but case insensitive
source code
 
popitem(self) source code
 
extend(self, other=None, **kwargs) source code
 
__repr__(self) source code
 
__len__(self) source code
 
keys(self) source code
 
iterkeys(self) source code
 
__iter__(self) source code
 
items(self) source code
 
iteritems(self) source code
 
values(self) source code
 
itervalues(self) source code

Inherited from UserDict.DictMixin: __cmp__, get, update

Class Methods [hide private]
 
from_fieldstorage(cls, fs)
Create a dict from a cgi.FieldStorage instance
source code
Method Details [hide private]

mixed(self)

source code 

Returns a dictionary where the values are either single values, or a list of values when a key/value appears more than once in this dictionary. This is similar to the kind of dictionary often used to represent the variables in a web request.

__contains__(self, key)
(In operator)

source code 
Overrides: UserDict.DictMixin.__contains__

has_key(self, key)

source code 
Overrides: UserDict.DictMixin.has_key

clear(self)

source code 
Overrides: UserDict.DictMixin.clear

setdefault(self, key, default=None)

source code 
Overrides: UserDict.DictMixin.setdefault

pop(self, key, *args)

source code 
Overrides: UserDict.DictMixin.pop

popitem(self)

source code 
Overrides: UserDict.DictMixin.popitem

__repr__(self)
(Representation operator)

source code 
Overrides: UserDict.DictMixin.__repr__

__len__(self)
(Length operator)

source code 
Overrides: UserDict.DictMixin.__len__

iterkeys(self)

source code 
Overrides: UserDict.DictMixin.iterkeys

__iter__(self)

source code 
Overrides: UserDict.DictMixin.__iter__

items(self)

source code 
Overrides: UserDict.DictMixin.items

iteritems(self)

source code 
Overrides: UserDict.DictMixin.iteritems

values(self)

source code 
Overrides: UserDict.DictMixin.values

itervalues(self)

source code 
Overrides: UserDict.DictMixin.itervalues