[Zope-CMF] is there a way to massupdate memberdata?

robert rottermann robert@redcor.ch
Mon, 20 Jan 2003 18:09:30 +0100


Thanks a lot,

I am wondering whether such a job should not be possible without external
scripts.

Robert
----- Original Message -----
From: "Troy Farrell" <troy@entheossoft.com>
To: "Zope-CMF" <zope-cmf@zope.org>; <robert@redcor.ch>
Sent: Monday, January 20, 2003 5:24 PM
Subject: Re: [Zope-CMF] is there a way to massupdate memberdata?


> If you want to update loads of info, how about building a decent UI, and
> looping over the External Method below.  You might add some intelligence
> so you don't try to set properties on anyone for whom they didn't change.
>
> My External Method is below.  I ought to add some more error checking,
> but I haven't yet.  uid is a member id, props is a mapping of the
> properties you want to try to set.  Using the security tab of the
> External Method, be sure you lock this one down really well (so people
> don't go messing with other people's data :)
>
> def setAMembersProperties(self, uid, props):
>    """ Set the properties in props (a mapping)
>    for portal member with id uid.
>    """
>
>    mtool = self.portal_membership
>    member = mtool.getMemberById(uid)
>    member.setMemberProperties(props)
>
> Troy
>
>