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.

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2011 Web Oom Suffusion theme by Sayontan Sinha
Switch to our mobile site
Top Footer