[ZPT] object located in in DTML but not ZPT

Jeremy Ryan jeremy.ryan at dsl.pipex.com
Mon Dec 15 17:44:54 EST 2003


Hi, I'm fairly new to Zope and am trying to learn to use ZPT rather than
DTML.

I'm using a "Sequences" Product as a primary key generator. I have created
an instance of this called "pkGenerator" in the same folder as my page
template. If I want to get the next sequence value I can call a DTML method
(called "sequencePuller") containing simply this:

     <dtml-var "pkGenerator.getNextValue()">

which works when called from the following line in a form on my template:

    <input type="hidden" name="pk" tal:define="primaryKey
here/sequencePuller" tal:attributes="value string:$primaryKey" />

This seems like an awful hack to me, and I'd like to do it in entirely in
TAL/TALES. I want to do something like:

      <input type="hidden" name="pk" tal:attributes="value
pkGenerator.getNextValue()" />

but that doesn't work. I get a compilation error:

      TAL.TALDefs.TALError: Invalid variable name
"pkGenerator.getNextValue()" in expression 'pkGenerator.getNextValue()'...

 Does anyone know if/how I can do this?

Jeremy




More information about the ZPT mailing list