[Zope] Re: How do I update objects?
Oliver Marx
Oliver@tekk.dk
Mon, 17 Feb 2003 13:58:07 +0100
Maik Jablonski wrote:
> Oliver Marx wrote:
>
> > Dear list
> >
> > I have a product which I want to extend.
> > I want to add a property.
> >
> > In my ZODB I all ready have ~1000 objects stored. And I would hate if
> > I have to add them again.
> >
> > Is there a way to update the existing objects?
>
>
> Simply add the new property to your global class defintion and to the
> PropertySheet-defintion:
>
> class YourObjectClass(SimpleItem, PropertyManager):
> """ A class to build ... """
>
> newProperty = ''
>
> _properties = ({'id': 'title', 'type': 'string', 'mode': 'w'},
> {'id': 'newProperty', 'type': 'string', 'mode':'w'},)
>
>
> Zope will update your existing objects at startup this way.
>
> Cheers, Maik
I would like this newProperty to have the value aq_parent.title. But
newProperty = Implicit.aq_parent.title
Does not work. Can it be done?
\Oliver