[Zope-dev] calling zsql-methods with variable queries

Chris Withers chrisw@nipltd.com
Mon, 05 Aug 2002 09:48:09 +0100


(This question would be better directed to zope@zope.org)

Arthur Tomas wrote:
> Hi,
> 
> can anybody tell me any possibility for
> calling ZSQL-Methods (MySQL) with variable queries
> ... something like:
> 
> in python:
> query = "select * from myTable where myColumn=42"
> return context.sqlMyQuery(query)
> 
> in zsql method:
> <dtml-var query>
> 
> and so on...
> 
> but it does not seem to be the right way...

What I'd do is pass the query as a parameter to the ZSQL method and then as you 
need in your ZSQL method is:

<dtml-var query>

...then you call your ZSQL method, for example, like:

context.my_sql_method(query="select * from myTable where myColumn=42")

cheers,

Chris

> ATOM
> 
> Replay To: arthur.tomas@web.de
> ______________________________________________________________________________
> FreeMail in der Premiumversion! Mit mehr Speicher, mehr Leistung, mehr 
> Erlebnis und mehr Praemie. Jetzt unter http://club.web.de/?mc=021105
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 
>