OT Re: [Zope-DB] writing a template to test if the sql worked

Chris Withers chris at simplistix.co.uk
Fri May 7 04:23:41 EDT 2004


Philip Kilner wrote:

> Re. ZPT, well all my stuff is "inside" (e.g. in, or called by) 
> index_html, which is a ZPT.

That sounds odd. The usual method I use is a ZPT-based form that calls a getData 
method that pull info for the form fields out of the REQUEST or stored data, 
which submits to a "processing" script tha tdoes validation, and edit/add, and 
the nreturns either the form ZPT if there wer eproblems or wherever seems most 
natural to go in other circumstances...

> by a universal "form rendering ZPT", called in turn by the top-level 
> ZPT,

Whaat does this "call" look like? Seems very odd...

> the next form in the sequence is thrown. At the end of the sequence, 
> instead of the form-rendering ZPT being called a "result" ZPT is called, 

That should be a PythonScript...

> All forms submit to ".", which equates - in my misty understanding - to 
> "self" - e.g. index_html, which in turn calls the script.

Bzzzt. Bad, IMHO. Always have URLs as form actions to avoid surprises.

>> Sounds fine to me: it is generally possible to see how things interact 
>> simply from the folder structure. I normally work in a similar manner 
>> although I normally pass forms to scripts to valid and process and get 
>> them to add values to the request if necessary, ie. when passing error 
>> messages as I much prefer this over TALES options.

TALES options?

>> However, Jim Penny made a very good case for having a PythonScript 
>> essentially be the index_html calling ZPTs or other objects as 
>> required this being a good way of preventing unpleasant or unexpected 
>> things happening. I can't find it locally or online, maybe he can 
>> repost it.

Well, it's pretty simple to call ZPT's from Python Scripts... what seems to be 
the problem?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk




More information about the Zope-DB mailing list