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

Norbert Marrale norbert at vsmpro.com
Sat Aug 5 19:48:35 EDT 2006


Dieter Maurer wrote:
> 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.
> 

Of course, duh! That's easy enough to implement.
Sometimes it's easy to overlook the obvious :)

Thanks!

Norbert



More information about the Zope-CMF mailing list