[Zope] My never-ending aquisition problem (calling ZSQL from PythonScript) (SOLUTION?)

Tom Smith tom@othermedia.com
Tue, 6 Nov 2001 11:00:11 +0000


I think I may have sorted this out again (but it somehow doesn't seem 
right)

If you call a ZSQLMethod from a PythonScript and then use the results as 
an object, rather than iterating through that object, you get funny Not 
Found errors. For example...

results = context.do_some_sql(some_params)
return results

...will not return a list of  <db results> objects (which I think it 
should).

but this will work fine...

results = context.do_some_sql(some_params)
result_list - [ ]
for i in results:
	result_list.append(i)
	# result_list.append(i.id)
	#result_list.append(i.some_other_attribute)
return result_list

...why is this? It keeps catching me out.