Why is CGI module so complicated?

Ian Clarke I.Clarke at NOSPAM.strs.co.uk
Fri Aug 6 11:52:08 EDT 1999


I have been writing an application using the cgi module, and am somewhat
confused as to why data is returned in FieldStorage or MiniField storage
objects, why not just return it in a plain dictionary?

At the moment, lets say you want to access a CGI variable called "pie"
you need to use:

f = cgi.FieldStorage()
print f['pie'].value

But why not just:

f = cgi.FieldStorage()
print f['pie']

That way the FieldStorage object would be a true dictionary, and could
be used as, for example, a TemplateDocument's substitutions dictionary.

I would write a wrapper to get rid of all of the FieldStorage objects,
but I have almost finished my code :-(

Can anyone explain what the point of the FieldStorage and
MiniFieldStorage objects are?

Ian

-- 
Remove the "NOSPAM." from my email address before replying.




More information about the Python-list mailing list