-
Book Overview & Buying
-
Table Of Contents
Mastering Django: Core
By :
In an HttpRequest object, the GET and POST attributes are instances of django.http.QueryDict, a dictionary-like class customized to deal with multiple values for the same key. This is necessary because some HTML form elements, notably <select multiple>, pass multiple values for the same key.
The QueryDicts at request.POST and request.GET will be immutable when accessed in a normal request/response cycle. To get a mutable version you need to use .copy().
QueryDict implements all the standard dictionary methods because it's a subclass of dictionary, with the following exceptions.
QueryDict.__init__()
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...
Change the font size
Change margin width
Change background colour