[Erp5-dev] search for email fast (portal_catalog?)

Jérôme Perrin jerome at nexedi.com
Tue Mar 21 18:33:41 CET 2006


Le Lundi 20 Mars 2006 13:57, Yoshinori Okuji a écrit :
> On Monday 20 March 2006 13:47, Bartek Gorny wrote:
> > I need to quickly find an email address in ERP5 database - is there a
> > way to use portal_catalog for it, to search object by url_string
> > property? Should I add something to portal_catalog settings, or create
> > an sql method, or what?
>
> This is a good question. The usual way is to add "url_string" to the
> catalog table (or a new table). But it might be better to change the
> property to "reference", since an URL is a kind of reference in the ERP5
> concept.
>
> What do others think about this?

Originally, email address were available to catalog using SearchableText from 
compatiblity table, but currently this table is disabled by default. 

So one solution could be to enable the compatibility table as described in 
rafael's howto 
http://www.erp5.org/sections/documentation/howto/howto_create_a_full/view

and do a search like this :

email_list = context.portal_catalog( portal_type = 'Email',
                             SearchableText = 'email at domain.net' )
person_list = [email.getObject().getParentValue() for email in email_list]

-- 
Jérome



More information about the Erp5-dev mailing list