Peter Bengtsson wrote:
Just like there's DTMLFile and PageTemplateFile, what about ZSQL Methods? So that you can run ZSQL methods from the filesystem (for a python product)
If not, I'll have to open my filesystem files and programmatically create these objects.
I usually just create ZSQL Methods as attributes of my (product) class: import Acquisition from Products.ZSQLMethods.SQL import SQL class mySQLClass(Acquisition.Implicit): # We need Acquisition in order to find our db connection # a database connection with this id must exist! dbconnection = "the_db_connection" _sql_null = "select 1 as one" zsql_null = SQL('null', 'A dumb zsql method for testing purposes', dbconnection, '', _sql_null, ) An instance of "mySQLClass" then could call self.zsql_null just like a standard ZSQL Method For details, take a look at Products.ZSQLMethods.SQL or its superclass, Shared.DC.ZRDB.DA.DA - peter.