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

Richard Flaaten richard at flaaten.com
Mon Jul 30 13:20:53 EDT 2007

<quote who="Charlie Clark">
> 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.
> http://www.egenix.com/library/presentations/EuroPython2007-Zope-and-RDBMS/
> Charlie
> --
> Charlie Clark
> eGenix.com

Dear Charlie,

Thanks for your input.

All I want to do is use the dtml-sqlvar argument as a string in my ZPT. My
ZPT is simply a report containing the results of the SQL query; I need to
use the argument as a title for the page. I am not passing any arguments
in the ZPT.


Richard Flaaten
[richard at flaaten.com, mobil 905 87 330]

More information about the Zope-DB mailing list