[Zope] Zope (X)3 FAQ

Max M maxm@mxm.dk
Mon, 07 Apr 2003 12:30:44 +0200


Lennart Regebro wrote:

> Max M wrote:
>
>> It would be nice to do this in a more interactive way. Like a small 
>> updater product (in Z2) wich could work like the following ascii art:
>
>
> Well, what you do it that you have a generic script that does this and 
> it calls the objects update script, and returns information if it was 
> updated or not. 


Yes I know that. It would typically be an external method wich looks 
like this:

def addBirthdayAttribute(self):
    "migrates"
    meta_type = 'Some Product'
    objects = self.ZopeFind(self,
            obj_metatypes=[meta_type], search_sub=1)
    for path, obj in objects:
        if not hasattr(obj, 'birthday'):
            obj.birthday = 0

But the other approach would give new users a different feel.

regards Max M