-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of zope Sent: Thursday, July 25, 2002 11:26 PM To: zope@zope.org Subject: [Zope] Newbie to Zope Hi I am a Newbie to zope. I am interested in working in zope and have been involved in work related with Pythonscripts and PostgreSql and Page Templates. I have become stuck at a point and I am not able to find what to do next. I am using a python Script to run a ZSQL method and then the values are to be sent to the Page Template to be displayed.The Script is: from Products.PythonScripts.standard import html_quote r = context.ond.db.zqll_clin # this is a zsql method in a different folder at root for x in r: print x['Id'],x['Name'],x['tt'] # these are the fields of the table return r The error message I get is Error Type: KeyError Error Value: 0 Am i not being able to get the record set from the database?Because if I give a print command in the loop it does not work.HEnce it may not be entering the loop.What is the method to access a Zsql Method which is another folder? If there is someone who could help me out here it would be very helpful.Since i am stuck with this problem for 2 days and I have tried other possibilities. John -- You have *call* the ZSQLMethod, which you're not doing. You're just referencing it. Try: r = context.ond.db.zqll_clin() (note the parens for the call at the end) BTW, why are you going from ZSQLMethod -> PythonScript -> PageTemplate? In most cases, the ZSQLMethod returns data that you can just iterate over and display directly in the PageTemplate; in cases where you want to clean up the data, using a PluggableBrain is usually a cleaner option than iterating and creating a new list in a PythonScript. Search the list or The Zope Book for info on PluggableBrains. - J.