Jul 252009
get( )
is a method available on any Python dictionary, letting you ask for the value of a particular key and specify a default to fall back on if the key doesn’t exist.
e.g.,
query=request.GET.get(‘q’,”)
If there is no q, then query becomes empty string.
