[Zope] How do I access the Standard Cache Manager API in Zope?

Braun Brelin bbrelin at openapp.biz
Thu Aug 12 12:21:33 EDT 2004


Hello,

I'm trying to write a small python script which will use the Standard
Cache Manager's RAMCache class API's (ZCache_set(), ZCache_get(),
ZCache_invalidate(), etc.).  

In my zope site (Running Zope 2.6.1) I've already got a DataCache object
created. 

I'm trying to do something like the following: 

PortalID=context.portal_url.getPortalObject().getId()
dcache = context.restrictedTraverse(PortalID + "/" + "DataCache")

I then try and access various functions like:

dcache.ZCache_get()
dcache.ZCache_set()
etc.

and I've tried
dcache.RAMCache.ZCache_get()
dcache.RAMCache.ZCache_set()

etc.

this, however, doesn't seem to work since I get attribute errors for the
methods.  

Anyone able to tell me the proper way to access the methods? 

Thanks,

Braun Brelin







More information about the Zope mailing list