quetz-mod_python-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Fraser <dav...@sjsoft.com>
Subject get method for FieldStorage class
Date Wed, 02 Apr 2003 11:00:38 GMT
Hi

I found when accessing FieldStorage to retrieve form arguments I often 
wanted to use a default value if the particular argument was not present 
in the form, rather than having to check has_key etc.
Since FieldStorage is basically meant to be like a dictionary, I added a 
get method like {}.get
I have attached a patch for this. Is this the right place to send it?

I also wondered whether it might be a good idea to have a version of 
FieldStorage that actually is a dictionary - i.e. derives from the dict 
type for Python 2.2 and up. That way there would be much more 
flexibility in handling values. I know in our application the first 
thing we do when handling a form is get the values we need and add them 
to the dictionary. Any thoughts?

Regards
David


Mime
View raw message