[Zope] manage_addMyZClass
Mark James Adams
mark@raysend.com
Tue, 3 Jul 2001 20:51:57 -0400
Hi Gang,
I've created an external method manage_addMyZClass, basing my method off
http://www.zope.org/Members/tazzzzz/addZClasses .
However, whenever I call this external method on an ObjectManager
derived ZClass, I get the error "Error Type: AttributeError; Error
Value: this" on line 8, which just happens to be:
self = self.this()
I know that the this() call is needed so self equals the current context
of the ObjectManager on which manage_addMyZClass is being called.
Is there any other way to programmatically add a ZClass defined through
the ZMI? And while I'm on that topic, what are the benefits/tradeoffs
between using the ZMI to define products and using Python? I recently
read the "A very minumal Product" How-To
(http://www.zope.org/Members/maxm/HowTo/minimal_01), and noticed that
this showed how write a manage_addMyZClass method in the context of a
Python based product.
The only reasons I've been given about defining products in the
filesystems with Python vs. using the ZMI are being able to use external
editors and CVS. Neither of these reasons are compelling enough for me,
so why should else I use Python?
I'm just starting a another Zope based site, and I have a slew of
ZClasses to define. In the other (and first Zope based site) that I
created and maintain I used only the ZMI to define ZClasses, so I'm
pretty familiar with the process.
Also, if I decide to go with Python based products, is there any easy
way to turn a ZClass defined though the ZMI into a Python product? I'm
not to worried about retyping code, but I've defined some fairly large
propertysheets that would be annoying to recreate if I were to start
from scratch.
Thanks!
--
Mark Adams
mja27@cornell.edu
"A man talking sense to himself is no madder than a man talking nonsense
not to himself." - Rosencrantz and Guildenstern Are Dead