[Zope-dev] Adding properties in __init__

Itamar Shtull-Trauring itamar@maxnm.com
Tue, 07 Nov 2000 14:19:33 +0200


Chris Withers wrote:

> self.manage_addProperty('AProperty','1\n2\n3','lines')

> I'm guessing that this is because self isn't an acquisition wrapper in
> __init__ (even though SimpleItem is Acquisition.Implicit) but what am I
> supposed to do to add a property in __init__?

I usually override _properties in the subclass, with the new property
definition, and then doing 

	self.Aproperty = '1\n2\n3'

works nicely.

-- 
Itamar S.T.  itamar@maxnm.com
Fingerprint = D365 7BE8 B81E 2B18 6534  025E D0E7 92DB E441 411C