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

Troy Farrell troy@entheossoft.com
Mon, 20 Jan 2003 10:24:53 -0600


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