[Erp5-dev] error on wiki page, pls check

Bartek Gorny bartek at redpoint.mn.pl
Tue Mar 28 19:36:56 CEST 2006


Thx - it works. I corrected the wiki.

It works ok for empty emails too, even without the 'optional' attribute.

Bartek

On 3/28/06, Jérôme Perrin <jerome at nexedi.com> wrote:
> Le Mardi 28 Mars 2006 16:32, Bartek Gorny a écrit:
> > Hi
> >
> > Can somebody please check the wiki page that I wrote two days ago, on
> > HowToAddTableToCatalog? I figured out that what I wrote there is
> > wrong, because the z_catalog_email_list is called every time I reindex
> > any object, which throws an exception if it the object is not an email
> > address. So I guess there must be a way to specify which catalog
> > methods are called when reindexing certain portal_types, or something
> > like that, but I don't know how.
>
> Hi bartek
>
> Currently, in various catalog method (stock, movement, item ...) we check
> wether we should index the object in the method.
> For exemple, z_catalog_movement_list first check the list of objects that are
> actually movement (using isMovement attribute) and only catalog them if the
> attribute is true.
> So in your case, you can just filter the list of objects, using for example
> getPortalType.
>
> But this may still fail for empty emails, you have use "optional" attribute to
> dtml-sqlvar so that it doesn't complain with None values.
>
> -  <dtml-sqlvar expr="getUrlString[loop_item]" type="string">
> +  <dtml-sqlvar expr="getUrlString[loop_item]" type="string" optional>
>
> Another solution can be cataloging objects only if getUrlString is not None.
>
> --
> Jérome
>



More information about the Erp5-dev mailing list