passing a zope <dtml-in...> list element to a sql method
I am attempting to access an element from a list and pass the element to a SQL method. The SQL method can see the list if I put it in the arguments list for the SQL method. However, I only want an element of the list. I have the following code (in my form submit action): ... ... <dtml-elif name="delete_button_delete_a_category_form"> <dtml-try> <dtml-in category prefix=MyElement> <dtml-var MyElement_item><br> <dtml-var a_trash> </dtml-in> ... ... MySQL: Argument: MyElement_item <<<< doesn't work INSERT INTO trash VALUES ('<dtml-var name="MyElement_item" sql_quote>') I can see the elements iterating with the <dtml-var MyElem....> statement. I can also see the sql statement executing during each loop if I use a static element for the SQL value. I can even plop the whole list into the SQL each iteration. However, I only want to plop in the current element of the iteration. What must I do?? _________________________________________________________________ Frustrated with dial-up? Get high-speed for as low as $29.95/month (depending on the local service providers in your area). https://broadband.msn.com
Roger Mallett wrote at 2003-9-28 05:33 +0000:
I am attempting to access an element from a list and pass the element to a SQL method.
If "l" is a list, you access its "i"th element with "l[i]". To pass an argument to a Z SQL Method, you pass it as keyword argument: "YourZSQLMethod(argument1=val1, argument2=val2,...)". Dieter
participants (2)
-
Dieter Maurer -
Roger Mallett