[Zope] SQL query in ZSQLMethod

David H bluepaul at earthlink.net
Sat Sep 24 23:37:25 EDT 2005


How do you want to change this notation? What is it you want to do?  
Please spend as much time writing a question as someone may in answering it!

You do not want logic in your zsql methods.
I tend to use python scripts for branching logic, eg

# python script
request = context.REQUEST
if request.get('value1') == someValue:
   do the add zsql
else:
  do the edit zsql.


celtek at wp.pl wrote:

> Hi,
> In ZSQLMethod I would have SQL query similar to this logic:
>  
> IF
> value1=<dtml-var value1> and value2=<dtml-var value2>
> THEN
> update table set(
> name='<dtml-var name>'
> )where value1=<dtml-var value1> and value2=<dtml-var value2>
> ELSE
> insert into table values(
> Id,
> name='<dtml-var name>',
> value1=<dtml-var value1>, 
> value2=<dtml-var value2>
> )
> I can't figure out how to change this notation.
>  
> Many greetings and thanks for every answer!  
>  
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050924/ed78e9a4/attachment.htm


More information about the Zope mailing list