[Zope] manage_addclassname and internal ZClasses

John R. Daily jdaily@progeny.com
Tue, 13 Mar 2001 10:40:57 -0500


I'm writing an internal ZClass, and I'm having problems with the
manage_addclassname function.

I modelled it on the classname_add DTML method created by default, and
I can't claim that I fully understand what I'm writing, unfortunately.
Most of the ZClass documentation, especially with regards to the
manage_add* methods, pertains to external Python code.

Here's a slimmed-down version of my manage_addFooClass():
---
foo = container.FooClass.createInObjectManager(id, context.REQUEST)
foo.manage_changeProperties( { 'title' : 'some title' } )
return foo
---

This is invoked by a test script like:
---
foo = container.manage_addProduct['Foo'].manage_addFooClass(id)
return foo.getId()
---

The rub: the new title 'some title' is applied to the container of the
new object, not the object itself.

According to the documentation I can find on createInObjectManager(),
the new object is supposed to be returned, and the other functionality
I formerly had in this method seems to back that up.

What's going on? Also, does anyone know of any internal ZClasses I can
install that are as full-featured as external ones?

Also, for subclasses, is it sufficient to define the manage_add*
methods alongside the factories for those subclasses? It seems to
work, but I've not gotten very far with my testing.

Thanks.

--                                                                   --
John R. Daily                                        jdaily@progeny.com
Systems Programmer                                Progeny Linux Systems
		  Master of the ephemeral epiphany