class documentation

class QueryDict(MultiValueDict): (source)

View In Hierarchy

A specialized MultiValueDict which represents a query string. A QueryDict can be used to represent GET or POST data. It subclasses MultiValueDict since keys in such data can be repeated, for instance in the data from a form with a <select multiple> field. By default QueryDicts are immutable, though the copy() method will always return a mutable copy. Both keys and values set on this class are converted from the given encoding (DEFAULT_CHARSET by default) to str.

Class Method fromkeys Return a new QueryDict with keys (may be repeated) from an iterable and values from value.
Method __copy__ Undocumented
Method __deepcopy__ Undocumented
Method __delitem__ Undocumented
Method __init__ Undocumented
Method __setitem__ Undocumented
Method appendlist Append an item to the internal list associated with key.
Method clear Undocumented
Method copy Return a mutable copy of this object.
Method encoding.setter Undocumented
Method pop Undocumented
Method popitem Undocumented
Method setdefault Undocumented
Method setlist Undocumented
Method setlistdefault Undocumented
Method urlencode Return an encoded string of all query string arguments.
Property encoding Undocumented
Method _assert_mutable Undocumented
Instance Variable _encoding Undocumented
Instance Variable _mutable Undocumented

Inherited from MultiValueDict:

Method __getitem__ Return the last data value for this key, or [] if it's an empty list; raise KeyError if not found.
Method __getstate__ Undocumented
Method __repr__ Undocumented
Method __setstate__ Undocumented
Method dict Return current object as a dict with singular values.
Method get Return the last data value for the passed key. If key doesn't exist or value is an empty list, return `default`.
Method getlist Return the list of values for the key. If key doesn't exist, return a default value.
Method items Yield (key, value) pairs, where value is the last item in the list associated with the key.
Method lists Yield (key, list) pairs.
Method update Extend rather than replace existing key lists.
Method values Yield the last value on every key list.
Method _getlist Return a list of values for the key.
@classmethod
def fromkeys(cls, iterable, value='', mutable=False, encoding=None): (source)

Return a new QueryDict with keys (may be repeated) from an iterable and values from value.

def __deepcopy__(self, memo): (source)
def __delitem__(self, key): (source)

Undocumented

def __init__(self, query_string=None, mutable=False, encoding=None): (source)
def __setitem__(self, key, value): (source)
def appendlist(self, key, value): (source)

Append an item to the internal list associated with key.

def clear(self): (source)

Undocumented

def copy(self): (source)

Return a mutable copy of this object.

@encoding.setter
def encoding(self, value): (source)

Undocumented

def pop(self, key, *args): (source)

Undocumented

def popitem(self): (source)

Undocumented

def setdefault(self, key, default=None): (source)
def setlist(self, key, list_): (source)
def setlistdefault(self, key, default_list=None): (source)
def urlencode(self, safe=None): (source)

Return an encoded string of all query string arguments. `safe` specifies characters which don't require quoting, for example:: >>> q = QueryDict(mutable=True) >>> q['next'] = '/a&b/' >>> q.urlencode() 'next=%2Fa%26b%2F' >>> q.urlencode(safe='/') 'next=/a%26b/'

Undocumented

def _assert_mutable(self): (source)

Undocumented

_encoding = (source)

Undocumented

_mutable = (source)

Undocumented