http.QueryDict.setdefault()

QueryDict.setdefault(key, default=None) [source] Just like the standard dictionary setdefault() method, except it uses __setitem__() internally.

http.QueryDict.setlist()

QueryDict.setlist(key, list_) [source] Sets the given key to list_ (unlike __setitem__()).

http.QueryDict.setlistdefault()

QueryDict.setlistdefault(key, default_list=None) [source] Just like setdefault, except it takes a list of values instead of a single value.

http.QueryDict.update()

QueryDict.update(other_dict) Takes either a QueryDict or standard dictionary. Just like the standard dictionary update() method, except it appends to the current dictionary items rather than replacing them. For example: >>> q = QueryDict('a=1', mutable=True) >>> q.update({'a': '2'}) >>> q.getlist('a') ['1', '2'] >>> q['a'] # returns the last '2'

http.QueryDict.urlencode()

QueryDict.urlencode(safe=None) [source] Returns a string of the data in query-string format. Example: >>> q = QueryDict('a=2&b=3&b=5') >>> q.urlencode() 'a=2&b=3&b=5' Optionally, urlencode can be passed characters which do not require encoding. For example: >>> q = QueryDict(mutable=True) >>> q['next'] = '/a&b/' >>> q.urlencode(safe='/') 'next=/a%26b/'

http.QueryDict.values()

QueryDict.values() Just like the standard dictionary values() method, except this uses the same last-value logic as __getitem__(). For example: >>> q = QueryDict('a=1&a=2&a=3') >>> q.values() ['3']

http.QueryDict.__contains__()

QueryDict.__contains__(key) Returns True if the given key is set. This lets you do, e.g., if "foo" in request.GET.

http.QueryDict.__getitem__()

QueryDict.__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.datastructures.MultiValueDictKeyError if the key does not exist. (This is a subclass of Python’s standard KeyError, so you can stick to catching KeyError.)

http.QueryDict.__init__()

QueryDict.__init__(query_string=None, mutable=False, encoding=None) [source] Instantiates a QueryDict object based on query_string. >>> QueryDict('a=1&a=2&c=3') <QueryDict: {'a': ['1', '2'], 'c': ['3']}> If query_string is not passed in, the resulting QueryDict will be empty (it will have no keys or values). Most QueryDicts you encounter, and in particular those at request.POST and request.GET, will be immutable. If you are instantiating one yourself, you can make it

http.QueryDict.__setitem__()

QueryDict.__setitem__(key, value) [source] Sets the given key to [value] (a Python list whose single element is value). Note that this, as other dictionary functions that have side effects, can only be called on a mutable QueryDict (such as one that was created via copy()).