[Zope-CMF] Sorting member roster by custom property

Kevin Carlson khcarlso@bellsouth.net
Tue, 7 May 2002 10:43:48 -0400


As it turns out, I don't think what I was trying to do was possible.  I did
solve the problem however, by modifying the list of dictionaries returned
from portal_membership.getRoster() to include the custom properties and then
calling dtml-in...

K

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
Of Kevin Carlson
Sent: Monday, May 06, 2002 5:31 PM
To: zope-cmf group
Subject: [Zope-CMF] Sorting member roster by custom property


Hi,

I have added several custom properties to the portal_memberdata tool and can
successfully add new users to the roster.  I would like to be able to
display the roster sorted on a customer property but am having the following
problem.

If I use this code:

	<dtml-let roster="portal_membership.getRoster()">
	<dtml-in roster mapping>
	<dtml-let member="portal_membership.getMemberById(id)"
ln="member.getProperty('lastName')" fn="member.getProperty('firstName')"
r="member.getRoles()">

things work fine but aren't' sorted.  If I want to sort by lastName or
firstName I cannot specify the property in a "sort=" attribute for the
dtml-in tag because it doesn't exist in the returned mapping.

Is it possible to reference an attribute of the memberdata object like this
or do I need a custom sort routing to build a list of dictionaries?

Thanks,

Kevin




_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests