[Zope] msSql and python

Floyd May fmay at okcareertech.org
Thu Nov 10 12:04:05 EST 2005


You can pass arguments to ZSQL Methods.  In this particular case, I
assume that you don't want the WHERE clause in the query if the
'description' parameter is not passed?

You can do it like this (inside the query):
--------------8<------------------------
<dtml-if description>
WHERE description = <dtml-sqlvar description type="string">
</dtml-if>
--------------8<------------------------

Then, inside your python script:
--------------8<------------------------
desc = 'some string'
context.path.to.query.queryname(description=desc)
--------------8<------------------------

Hope that helps!

fm

On 11/10/05, Kate Legere <klegere at kfpl.ca> wrote:
> I have a zsql method to which I want to pass and argument. Normally I do it
> from a dtml method and the use something like this to test for equality.
>
> WHERE  description = <dtml-sqlvar description type=string>.
>
> However, I'm passing the variable from a python script and it won't accept
> the dtml tag.... what do I put in the equality test?
>
>
>
>
> Kate
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>


More information about the Zope mailing list