[Zope] Re: Upgrading Zope Products

Brian Brinegar brinegar at purdue.edu
Thu Mar 24 13:35:55 EST 2005


> You can set default values on the object's class which will be picked
> up.  E.g.,
> 
> ~  # old version
> ~  class Foo(SimpleItem):
> ~      """ Foo objects.
> ~      """
> ~  bar = 0
> ~  baz = ''
> ~  _properties = ({'id': 'bar', 'type': 'int', 'mode': 'w'},
> ~                 {'id': 'baz', 'type': 'string', 'mode': 'w'},
> ~                )
> 
> ~  # updated version
> ~  class Foo(SimpleItem):
> ~      """ Foo objects.
> ~      """
> ~  bar = 0
> ~  baz = ''
> ~  qux = ()
> ~  _properties = ({'id': 'bar', 'type': 'int', 'mode': 'w'},
> ~                 {'id': 'baz', 'type': 'string', 'mode': 'w'},
> ~                 {'id': 'qux', 'type': 'tokens', 'mode': 'w'},
> ~                )

Tres,

This isn't the case. Some instances of my product (those that haven't
had properties added to them or changed) will pick up the changes, but
not all instances.

So for example, if I initiated an object of the old version, then added
additional properties through the ZMI, then changed the product code to
the updated version and restarted zope the new property will not show up
in that instance.

Also, this does not address adding a new index which is set normally set
during the __init__ method.

-Brian



More information about the Zope mailing list