[Zope] stupid question- ZSQL

Erik Stokhof Erik.Stokhof@cwi.nl
Thu, 08 Aug 2002 18:05:04 +0200


Hi all,
I'm a relative newbie in Zope, but I have Zope 2.3.3, and now I'd like to 
manipulate data from an sql query in a python script.
I read http://www.zope.org/Members/spinwing/ZSQL_Results , but as soon as I 
start asking for container.<query>().dictionaries() I get an attribute error.
So I had a look at the code, it's there. attributes, names, tuples, 
everything. Only I can't access half of them.
Help Help.
Any pointers?

-Erik

PS what I *really* want to do is similar to this:

list 1 contains types of lists
list 2 contains people on those lists

query: select list1.id, if(list2.list1_id=list1.id,'checked','') where 
list2.person_id = xxxx
this shoud ideally give me a table with
1 checked
2 checked
3
4 checked
or something like that. Only SQL doesnt; work like that, so I actually need 
to do:
select list1_id from list2 where person_id=xxxx
(gives me a list of ids)
select list1.id, if(list1.id in <the list of ids>,'checked','') where 
list2.person_id = xxxx
Now how to make the list, which simply needs to look like "1,2,4"