[Zope-DB] ZPTs and database accesses

Ken Winter ken at sunward.org
Thu Apr 28 14:26:47 EDT 2005


Andreas -

Thanks for your answer.  I'm relieved to know that the ZPT-ZSQL combination
will suffice for database accesses.  As a Zope neophyte, though, I still
need an example or tutorial showing me how to get data from page to database
via ZPTs and ZSQL objects.  Can you point me to such a reference?

- Thanks, Ken

> -----Original Message-----
> From: Andreas Jung [mailto:lists at andreas-jung.com]
> Sent: Thursday, April 28, 2005 2:17 PM
> To: ken at sunward.org; zope-db at zope.org
> Subject: Re: [Zope-DB] ZPTs and database accesses
> 
> 
> 
> --On Donnerstag, 28. April 2005 14:05 Uhr -0400 Ken Winter
> <ken at sunward.org> wrote:
> 
> > The Zope Book (version 2.7,
> > http://www.plope.com/Books/2_7Edition/ZPT.stx#1-8) implies that you
> can't
> > do "SQL queries" from Zope Page Templates.  If this implication is
> > correct, I (for one) have a problem, as I'm trying to do all my work
> with
> > ZPTs (rather than DTML) in order to use my WYSIWYG HTML editor
> > (DreamWeaver) to design my pages.
> >
> >
> >
> > The RDB chapter in the Zope book
> > (http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx#1-10)
> > shows a ZPT example that works for getting retrieved data from the
> > database through ZSQL objects onto web pages.  But I haven't found an
> > example of a ZPT for an HTML form that can take data from the web page
> > into the database.
> 
> You have not read the book correctly. First statement just said that you
> can't SQL queries using ZPT. In Zope you specify SQL queries using
> *ZSQL methods* that use DTML as markup language...this is not the same
> as defining SQL inside DTML methods/documents or Page Templates.
> Since ZSQL methods are first-class objects in Zope, you can call them
> of course from DTML method/documents, Python Scripts *and* Zope
> Pagetemplates
> (as shown in the RDBMS chapter).
> 
> Hope this makes things clearer,
> -aj




More information about the Zope-DB mailing list