In article <Pine.LNX.4.21.0101032012320.775-101000@localhost>, Aleksander Salwa
<[EMAIL PROTECTED]> writes
>On Wed, 3 Jan 2001, Robin Becker wrote:
>
>> Is there an easy way to make the Find tab case insensitive. It seems
>> like a very common need, but I see that FindSupport.py is calling
>> string.find which makes it seem as though this is harder than it should
>> be.
>
>Now, I did it better way. No regular expressions. Just case-insensitive
>search. "Case insensitive" checkbox on "Find" form.
>If you need it - just take a look at an attachment.
>Maybe I will send it to the Collector...
>
>
>[EMAIL PROTECTED], [EMAIL PROTECTED]
>
>/--------------------------------------\
>| `long long long' is too long for GCC |
>\--------------------------------------/
>
>[ A MIME APPLICATION / x-gtar part was included here. ]
>
that looks like a nice way to do it, but I reckon we could make the lambda stuff a bit 
cleverer
ie modify the default find

eg
  if search_caseins:
    FINDER = lambda ob,p=lower(obj_searchterm): 
find(lower(ob.PrincipiaSearchSource()),p)
  else:
    FINDER = lambda ob,p=obj_searchterm: find(ob.PrincipiaSearchSource(), p)

and then we use

    FINDER(ob)


-- 
Robin Becker

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to