[Zope-DB] Zope DB question
Mon, 06 Jan 2003 16:03:16 -0500
I have a product that I wrote in zope which is just a big hash. It
loads in company names as keys, and from a text file, adds ticker
items as each value for a particular key. Now I only want this huge
dictionary to load once, which is when zope starts up (possibly in a
global space), as I need one copy of it and I need that one copy to
update every x number of minutes. Currently, I think, each user that
views this product, loads his own copy of the hash, which makes it
slow and a memory hog. I only want a single copy available to all
users, and the data refresh time to be determined by the system or the
In the same python product, I am trying to access an ODBC database connection. I have tried 2 ways of accessing it, and both have failed. First I created a Z SQL method in the same directory as the Product, and tried to access that Z SQL method. My product subclasses SimpleItem, and so I tried self.getattr(name_of_Z_SQL_meth)(). The Z SQL method doesn't take any arguments, so that should have worked. Then I tried import SQL from Zope: from Products.ZSQLMethods.SQL import SQL, and running the SQL method directly. It always complains about the formation of the connection ID which I cannot seem to get right. Help on either of these issues would be greatly appreciated.
I am using: Zope 2.5.1 with Python 2.1.3 on win 2k professional.
Sign-up for your own FREE Personalized E-mail at Mail.com