[Zope] TinyTable instantiation (Was: Acquiring object from Products instances)

Tille, Andreas TilleA@rki.de
Wed, 8 May 2002 10:36:13 +0200 (CEST)


On Tue, 7 May 2002, Dieter Maurer wrote:

> Tille, Andreas writes:
>  > ### From the example ... but does not work anyway
>  > ##    ob = getattr(self, id) #we basically get the instance from the ZODB, now has AqWrapper
>  >
>  >     ob.manage_addFolder('someid') #works as expected
>  >     ob.manage_addTinyTable(id='link_table',
>  >                                title='TinyTableObject for '+ob.id,
>  >                                columns=column_names)
>  >
>  > The last line does not work because it does not put the TinyTable object
>  > into the new folder (where I was able to create the example folder named
>  > 'someid' but it will be created in the folder below.
> I expect this is because your "ob" does not have a "manage_addTinyTable"
> method but instead acquires it from "self". It is then
> this "self" that is passed in to "manage_addTinyTable" as first
> argument and gets the new tiny table.
>
> Probably, "TinyTable" uses old style initialization (see mailing list
> archive for an explanation). This would mean, it installs
> its constructors directly as so called
> folder methods in "OFS.Folder". Only classes derived from
> "OFS.Folder" have these constructors.
>
> You may try the official idiom to instantiate classes:
>
>     ob.manage_addProduct['TinyTable'].manage_addTinyTable(...)
>
> I expect it to work even with old style initialization but I am
> not sure.
I t worked not for me this way.

> If it does not work, converting the TinyTable to use new style
> initialization would probably the best way (again: the mailing
> list archives will tell you what's the difference).
Once I was told that even if Tinytable has the status

 Release    Version               Date        Size
 TinyTable  Beta 2 (Development)  1999/09/20  11376 bytes

shown at http://www.zope.org/Members/tsarna/TinyTable it is not
changed any more because it is thus stable.  My remark that at least
the web page has a bug (it should be declared "stable" and not Beta
if it is *stable*) was ignored so far.  Obviousely it now shows that
there could be some work done if I do understand Dieters remarks
right.  As usually in Free Software development someone might say:
"Do it yourself if you want it to be done." and this is OK for me.

But I use it in a quite low priority project and do not have time
(to require enough knowledge via Mailing archive or other resources
nor to do the exact fix) currently.  So take it please as a kind
hint to an open bug in the TinyTable product.  I could even bother
the Debian Bug Tracking System with this problem - but I guess the
Debian-Maintainer would do the same like me - just ask you people
whether someone likes to continue developing.

The same applies for the TInyTablePlus product.

Kind regards

        Andreas.

PS: I was talking about the complete example available at:

       http://www.foodborne-net.de/~tillea/MyFolder/MyFolder.tgz