[Zope] Tiny Tables Plus's Constructor
Dennis Allison
allison@sumeru.stanford.EDU
Thu, 25 Apr 2002 02:59:19 -0700 (PDT)
I've been using TTP and find it meets my needs for a "not quite a
database" sort of object. Up until now, I've created the tables using
the usual ZMI management interface.
Now I need to create, delete, and modify the tables programatically.
I've don't quite understand the interface for the product. A little help
would be much appreciated.
As I understand Zope, a Product's constructor is registerd with an
ObjectManager and accessed throught it, e.g.,
self.manage_addproduct['OFSP'].manage_addFolder(id,title)
is the usual pattern for creating a folder.
I looked at the TTP code. The constructor is addItem( self, id, title)
but I've been unable to grok how the product has registered with an
ObjectManager and under what name it is to be found. Where is the
product-type specified in the Product so I can locate the proper
ObjectManager instance to create new instances.
I have tried the obvious'TinyTablePlus' key. It found an ObjectManager
but the constructor 'addItem' was not found and so the constructor
self.manage_addproduct['TinyTablePlus'].addItem( 'newtable', 'test')
failed with a getattr error for addItem.
I suspected it might be a permissions problem. I checked the permissions
on the product panel and enabled all of the Tiny Table options (Add and
Change). Truth be told, I am not sure what the impact of those
permissions should be. I saw no change with my constructor problem...
Thanks for any help you can provide.