[Zope-CMF] Re: returning case insensitive matches for portal_membership.searchMembers()

Dieter Maurer dieter at handshake.de
Sat Aug 5 16:41:03 EDT 2006


Norbert Marrale wrote at 2006-8-4 17:53 -0400:
> ...
>Which brings me to my original Q...
>
>Is there a better way than the two-step approach I'm following:
>
>   emails = context.portal_membership.searchMembers('email','')
>
>and then iterate over emails to find the matches
>
>   if (member==string.lower(emails[n].values()[1])):

You could maintain an additional dictionary mapping the
(normalized) email address to the user id.

If you do not have such a mapping, then your code above is
as efficient as it can be.



-- 
Dieter


More information about the Zope-CMF mailing list