[Zope] Re: How do I update objects?

Maik Jablonski maik.jablonski@uni-bielefeld.de
Mon, 17 Feb 2003 14:09:38 +0100


Oliver Marx wrote:
> 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?

You should run an update-script which sets the required value for the 
newProperty after "upgrading" your objects... can be easily done with 
ZopeFindAndApply:

Zope/lib/OFS/FindSupport.py:

     def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None,
                          obj_searchterm=None, obj_expr=None,
                          obj_mtime=None, obj_mspec=None,
                          obj_permission=None, obj_roles=None,
                          search_sub=0,
                          REQUEST=None, result=None, pre='',
                          apply_func=None, apply_path=''):


-mj