[Zope] msSql and python

Kate Legere klegere at kfpl.ca
Thu Nov 10 12:22:24 EST 2005


That was it exactly - I didn't have the right python syntax but had thought
the mistake was in the zsql.

Thanks!

Kate

-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of
Floyd May
Sent: Thursday, November 10, 2005 12:04 PM
To: Zope
Subject: Re: [Zope] msSql and python

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 )
>
_______________________________________________
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