[Zope-DB] Reference DTML-sqlvar in ZPT?

Charlie Clark charlie at egenix.com
Mon Jul 30 13:00:41 EDT 2007

Am 30.07.2007, 18:55 Uhr, schrieb Richard Flaaten <richard at flaaten.com>:

> Dear list,
> I have a ZPT that lists results from a Z SQL Method. It has one argument:
> "dropdown-department". Everything works fine, except I cannot find a way
> to include the passed SQL argument as a string in the ZPT document!

> To explain it in another way, a user selects a value from a drop-down
> list. This value is passed to a Z SQL Method. My ZPT displays these
> results, and I need to include the passed value (DTML-sqlvar) in a  
> heading
> in the ZPT.

Neither explanation is particularly helpful but it sound like you're  
trying to do something you shouldn't!

You if you are wishing to call a ZSQL method and pass in a parameter from  
your template this is done using a Python expression:

tal:content="python: mySQLMethod(SQLvar=ZPTvar)"...

You can pass variables into a PageTemplate using the options dictionary.

You might want to look at my presentation (with sample code) which touches  
on Zope and RDBMS.



Charlie Clark

Professional Python Services directly from the Source
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::

     eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Zope-DB mailing list