[Zope-dev] Intializing theobjectsformerly-known-as-RackMountables

Phillip J. Eby pje@telecommunity.com
Wed, 19 Jul 2000 10:07:36 -0500


At 05:54 PM 7/19/00 +0300, Itamar Shtull-Trauring wrote:
>"Phillip J. Eby" wrote:
>
>> If what you want is default values, then just put them in a DataSkin
>> property sheet in the ZClass.  Or, if using a Python class, implement them
>> as class attributes named  "class_default_for_X".  E.g.:
>
>I don't like ZClasses all that much, I'd rather not use them.
>

Okay, then override _objectAdding().  Just be sure to call the original
implementation in your overridden version.  _objectAdding() is always
called with the invariants set up.  Note, however, that if you use
DataSkins outside of Racks, _objectAdding() is called when an object is
moved or copied, as well as when added.