[Zope] setting up a ZClass - base class of PropertyManager? plus weird gradual broken product messages

A M Thomas am@virtueofthesmall.com
Tue, 23 Apr 2002 10:29:17 -0400


Hi Steve,

Thanks for the follow up!

I have to respond about property sheets again... what I want is to take
advantage of the famous "acquisition" mechanism, but I want my class
instances to acquire from their _containing objects_ rather than from
their class property sheet values.  They seem to be inheriting from the
property sheet values even if the value is "blank" in the property
sheet.

Is there some way to control this, other than testing each thing? 
Creating an "undefined" value is not really going to work here; I've got
a whole bunch of different properties, some are selections, some boolean
(hard to set an undefined value for those), some text...  I could, of
course, define an additional property for each property already defined,
that specifies whether the property should come from the containing
object (true by default), but isn't the whole acquisition model supposed
to make this unneccessary?

I'm trying to do things the "right" way within Zope, but I'm still not
sure what that is for what I'm trying to accomplish.  I'm starting to
suspect that the ZClass approach may not be the best for what I want.

Many thanks,
Am

Steve Spicklemire wrote:
> > 2) If I create an instance
> > of a ZClass with a propertysheet, it seems to always define the
> > properties, and I want to inherit them from a parent object unless I
> > specifically define them in the new object.  I may be missing something,
> > but I seemed to get this effect, and that's why I switched to using
> > PropertyManager.
> 
> Hmmm... the property sheet only gives the class a value for the named
> properties. This "class" value gets used if the instance doesn't have a
> value of it's own. You can give the class value some "special" value
> (e.g., 'uninitialized') if you want to check an instance to see if
> you've set a custom value for that instance.
>