RE: [Zope] python products and properties
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Oliver Bleutgen
Right now I have to manually assign a newly added property to already existing instances, because adding the property in the _properties class attribute breaks the properties management tab of these instances. Am I missing something? What do others do?
class yourClass(parentClass):
_properties = parentClass._properties + ( {'id':'yourProperty', 'type': 'string'}, )
def __init__(self): self.yourProperty = ''
Something like this perhaps?
regards
Max M
Thanks, but then I would have to add a new class for every property I change + old instance wouldn't automagically get the new properties (ideally with some default value). I hoped there was a mechanism like there's in zclasses, where I only have to change the zclass to get the new properties. Is my problem really one of the prices which have to be paid in order to get the benefits of python products over zclasses? cheers, oliver
participants (1)
-
Oliver Bleutgen