[COLUG] CGI Question

Mark Erbaugh mark at microenh.com
Mon Aug 6 18:31:08 EDT 2007


I hope I'm missing something simple.

I'm starting to do some CGI work in Python. Right now, I'm doing the
code directly in Python. I'm hoping to avoid some of the larger
frameworks (i.e. Zope, et al).

Using python's cgi module, I can successfully extract data entered on
the form by the user after a POST or GET.  I can use this data and build
a new web page with the response.

What I want to do now is give the user an opportunity to edit their
input data. To do this, I want to redisplay the input page, but with the
values entered by the user.  So far, the only solution I've come up with
(but haven't implemented) involves reconstructing the entire input web
page. The web page was created in an HTML editor and that looks like
it's pretty complex, especially with things like selection lists, since
the options are in different tags.

Is there a reverse process to extracting form data where data can be
applied to a web page?  What I'm looking for is a way to fill in a data
structure similar to the cgi.FieldStorage() object and then be able to
combine that with an HTML page and have the value put into the
appropriate input fields.


TIA,
Mark



More information about the colug432 mailing list