[Zope-DB] Hello!

Charlie Clark charlie@begeistert.org
Mon, 21 Jul 2003 19:52:53 +0200


On 2003-07-21 at 18:56:17 [+0200], Jim Penny wrote:
> 1)  index_html is ALWAYS a Script (Python) in any of my code from the
> last 18 months.
> 
> 2)  The main form will have ZPT in it, only to do error handling.
> 
> The ISBN_entry_form_pt  [the tal presents an error message, if present, 
> and fills in the form with the most recent values if said values are in 
> the request.  This should happen only after an error.]:

Having looked at the forms and the scripts I can understand why you do this 
but it's not my preferred solution: I've gone on to breaking my scripts 
into smaller ones for manageability and explicit application function: my 
form processing script calls various dedicated checking scripts and usually 
has returns which are binary opposed: "if not error: success". I find the 
folder model also works well to help me remember without looking at the 
code what happens in any particular context. Mind you, I haven't got those 
18 months yet!!! 

ZPT TALES and METAL-macros allow you to reduce the the form to a single ZPT 
and I initialise the variables all together at the top of the template as 
required. So I think this is somewhat a matter of style.

Charlie