[Zope] mid-level architecture question -- populating forms

Dennis Allison allison@sumeru.stanford.EDU
Mon, 29 Apr 2002 10:50:12 -0700 (PDT)


I am putting together a site with that accesses and updates a database.
The essential structure is this:

the web-user is presented with a form and provides enough information for
the web application to find the desired information in the data base.
This key information is passed to a External Method that accesses the data 
base and determine which of a number of forms are needed to manage the
update.

The External Method then has a number of choices vis-a-vis how to publish 
the form.   Based on the key provided by the application and the data in 
the database, it can computed the name of a static form.  It can then 

1) construct a URL for the form with parameters to fill in the
blanks, e.g.,  specialised_form_1?field1=somedata&field2=moredata
and so forth.  I'm not sure how one would invoke this as I suspect 
getitem() would be confused.

2) evaluate the data values and put them in the REQUEST object, then 
pass down the string 'specialized_form' to the page where the form is 
to appear, generate the form with a <dtml-var expr="getitem(form-name,1)">
and have the form look up the fill-in-the-blanks data in the REQUEST
object.

3) generate the form on the fly (probably from a home-grown template) and
fill in the data directly.

4) ....

I'm leaning towards 2) but am still not really sure it's the best
approach.  Comments? 

-d  

PS:  Zope 2.5, dtml-ish site not templates.