Re: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-18 Thread Maciej Wisniowski
I tried to invoke the query method of my adapter (which is named dhatabase) with this code: p = context.REQUEST.get('delete_this') if p: s = ', '.join([str(x) for x in p]) t = delete from person where person_id in (%s); % s context.dhatabase.query(query_string=t) ...and

Re: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-18 Thread Maciej Wisniowski
P.S. I know that dtml-var... rather than dtml-sqlvar... is an unorthodox and apparently undocumented construct to use within a ZSQL definition. But I need it because dtml-sqlvar... malformats the string. What do you mean by 'malformats the string'? Have you tried dtml-sqltest clause? It

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-18 Thread JPenny
I also have a broader question: When one is composing dynamic SQL in Python scripts, what are the pros and cons of executing them by going directly to the database adapter (as suggested above) vs passing it in as the sole argument of an empty ZSQL method? By empty ZQL method I mean

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-18 Thread Ken Winter
-Original Message- From: Maciej Wisniowski [mailto:[EMAIL PROTECTED] Sent: Monday, June 18, 2007 1:34 AM To: Ken Winter Cc: 'Zope-DB List' Subject: Re: [Zope-DB] Using dtml-vars in ZSQL methods? I tried to invoke the query method of my adapter (which is named dhatabase

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-18 Thread Ken Winter
' Subject: RE: [Zope-DB] Using dtml-vars in ZSQL methods? I also have a broader question: When one is composing dynamic SQL in Python scripts, what are the pros and cons of executing them by going directly to the database adapter (as suggested above) vs passing it in as the sole

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-17 Thread Ken Winter
-Original Message- From: Charlie Clark [mailto:[EMAIL PROTECTED] Sent: Saturday, June 16, 2007 6:24 PM To: Ken Winter; 'Zope-DB List' Subject: Re: [Zope-DB] Using dtml-vars in ZSQL methods? ... FWIW you might want to call the query or execute methods directly on the DA connection

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-17 Thread Dieter Maurer
Ken Winter wrote at 2007-6-16 16:03 -0400: ... Exception Type KeyError Exception Value 'id_list' Traceback (innermost last): ... * Module Products.CMFCore.FSPythonScript, line 164, in _exec * Module None, line 4, in people_delete_control FSControllerPythonScript at

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-16 Thread Ken Winter
I have done. ~ Thanks ~ Ken -Original Message- From: Jaroslav Lukesh [mailto:[EMAIL PROTECTED] Sent: Saturday, June 16, 2007 1:41 AM To: Ken Winter; 'Zope-DB List' Subject: Re: [Zope-DB] Using dtml-vars in ZSQL methods? It is just because 'delete_this' is a string, not the list

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-16 Thread Andreas Jung
message to this thread documenting some further experiments I have done. ~ Thanks ~ Ken -Original Message- From: Jaroslav Lukesh [mailto:[EMAIL PROTECTED] Sent: Saturday, June 16, 2007 1:41 AM To: Ken Winter; 'Zope-DB List' Subject: Re: [Zope-DB] Using dtml-vars in ZSQL methods

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-16 Thread Ken Winter
PROTECTED] Sent: Saturday, June 16, 2007 3:27 PM To: Ken Winter; 'Zope-DB List' Subject: RE: [Zope-DB] Using dtml-vars in ZSQL methods? ... Second..it would be *really* helpful to see the full traceback instead of just *Keyerror*. It's somewhat boring to ask every time for it :-) --On 16. Juni

RE: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-16 Thread Ken Winter
Charlie ~ I tried several experiments based on your suggestion. See results inserted below. ~ Thanks, Ken -Original Message- From: Charlie Clark [mailto:[EMAIL PROTECTED] Sent: Saturday, June 16, 2007 3:54 PM To: Ken Winter; 'Zope-DB List' Subject: Re: [Zope-DB] Using dtml-vars

Re: [Zope-DB] Using dtml-vars in ZSQL methods?

2007-06-16 Thread Charlie Clark
Am 17.06.2007, 00:14 Uhr, schrieb Ken Winter [EMAIL PROTECTED]: dtml-comment title: Method to delete one Person by id connection_id: dhatabase arguments: person_id /dtml-comment delete from person where person_id = dtml-var person_id When I tried to delete a couple of People