[Zope] passing value to sql method question

Chris Beaven Chris@d-designz.co.nz
Tue, 25 Jun 2002 13:55:20 +1200


Hi Sean

You are correct that you are inside the speech marks (""), you have to talk
python rather than DTML. What you really want is:
<dtml-in expr="get_record(PermitNumber=PermitNumber)">

Or if this is a ZSQL then it's even simpler:
Just call it like:
<dtml-in get_record>


-----Original Message-----
From: Kelley, Sean [mailto:SKelley@ci.santa-rosa.ca.us]
Sent: Tuesday, 25 June 2002 11:33 a.m.
To: 'zope@zope.org'
Subject: [Zope] passing value to sql method question


Hi,
Learning dtml and zope...

I am trying to call an sql method called get_record and pass a parameter to
it.  This works if I hardcode the value into the dtml method like this:
<dtml-in expr="get_record(PermitNumber=12345)"> 

However,
The above line is in a dtml method called edit_dtml
So I want to call edit_dtml from an html document like this:
<a href="edit_dtml?PermitNumber=<dtml-var PermitNumber>"> <dtml-var Company
null=""></a>

The value of PermitNumber gets passed okay and can be displayed in the
called page (edit_dtml) with:
<dtml-var PermitNumber>

But I need to plug it into the dtml-in expresssion something like this:
<dtml-in expr="get_record(PermitNumber=<dtml-var PermitNumber>)">

But this generates a syntax error.  There must be a correct way to do this.
Any ideas on how else I might do it?
I assume that the part after expr=" must be python code and this is why this
does not work ??


Sean Kelley
Technology Coordinator
City of Santa Rosa



_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )