[Zope] Zope Product and Global Module Help
Chris Withers
chrisw@nipltd.com
Wed, 08 Jan 2003 09:27:26 +0000
sameer chaudhry wrote:
> 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.
How is this hash defined? If it's defined in a module or class-level variable
you should only have one copy loaded for eveyone.
> Product, and tried to access that Z SQL method. My product
> subclasses SimpleItem, and so I tried
> self.getattr(name_of_Z_SQL_meth)().
What did you get when you tried this?
> 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.
This sounds dodgy.
> 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.
The format of the connection string depends on the DA you're using. What DA are
you using?
cheers,
Chris