19 Jun
2006
19 Jun
'06
7:39 p.m.
Alric Aneron wrote:
Hello, I have a dictionary object and a result set object (that was returned from a ZSQL method). Is there any way I can merge them into one variable and use them in a dtml-in statement?
You should know which one should update which one. So assuming your dictionary has to override/extent attributes returned from ZSQL-Methods, you can write res=context.yourZSQLMethod(args...).dictionaries() # see API docs for item in res: item.update(yourdictionary) return res thats all. The other way round could be: res=context.yourZSQLMethod(args...).dictionaries() return [dict(yourdictionary,**item) for item in res] (see python docs about list comprehension and function argument forms) Regards Tino