[Zope-CMF] making a list of user email addresses

Tres Seaver tseaver@digicool.com
Sat, 19 May 2001 21:37:05 -0400 (EDT)


On Sat, 19 May 2001, tav wrote:

> >>>>> TS == "Tres Seaver" <tseaver@novacoxmail.com> wrote:
> 
>     TS> Have a look at the 'roster' skin method;  you would
>     TS> need to call 'getProperty()' on each member object
>     TS> returned from 'getRoster()' on the 'portal_membership' tool.
> 
> thanks for the pointer, but, i am lost on the getProperty() aspect...
> 
> i tried the following:
> 
>     <dtml-let roster="portal_membership.getRoster()">
>       <dtml-in roster mapping>
>          <dtml-with id>
>     <dtml-var "getProperty(id='email')">
>         </dtml-with>
>       </dtml-in>
>     </dtml-let>
> 
> but, it returns None... instead of the hoped for email addresses :/

That was my bad, for suggesting the wrong method.  'getRoster' 
returns the Wrong Thing (tm) for what you want (it returns a
list of dicts, each of which has 'id' and 'listed' keys).  Try
'listMembers' instead:
 
     <dtml-in expr="portal_membership.listMembers()">
      <dtml-let member=sequence-item>
       <dtml-var expr="member.getProperty( 'email' )">
      </dtml-let>
     </dtml-in>

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org