[Plone-IT] recuperare fullname di tutti i membri

Redbedbug redbedbug a gmail.com
Lun 28 Lug 2008 10:48:53 UTC


On Mon, Jul 28, 2008 at 12:36:03PM +0200, Franco Carinato wrote:
> per recuperare il Fullname dato l'id dell'utente tempo fa avevo usato
> una script tipo questo.. (ma non garantisco che sia l'ottimale.. )
> 
> ciao
> fc
> 
> 
> ## Script (Python) "nome_completo"
> ##bind container=container
> ##bind context=context
> ##bind namespace=
> ##bind script=script
> ##bind subpath=traverse_subpath
> ##parameters=id='fc'
> ##title=Nome Completo
> ##
> try:
>   member = context.portal_membership.getMemberById(id)
>   return member.getProperty('fullname', id)
> except:
>   return id

Ciao, intanto vi ringrazio (Riccardo incluso), li provero`.
Io intanto stavo scrivendo roba del genere:

from Products.CMFCore.utils import getToolByName

membership = getToolByName(self, 'portal_memberdata')

for member in membership.folderlistingFolderContents():
        if member.getPortalTypeName() == 'Member':
                if 'richiesta ricerca' in getattr(member, 'fullname'):
                        search_req = '%s,%s,%s' % (getattr(member,'fullname'), getattr(member, 'email'), getattr(member,
'telephone_number'))
 

Provo e poi vi faro` sapere.

> > On Monday 28 July 2008, Redbedbug wrote:
> >> Suggestions?
> >
> 
> _______________________________________________
> Plone-IT mailing list
> Plone-IT a lists.plone.org
> http://lists.plone.org/mailman/listinfo/plone-it
> http://www.nabble.com/Plone---Italy-f21728.html




Maggiori informazioni sulla lista Plone-IT