[Zope] ZCatalog of method output

Loren Stafford lstafford@icompression.com
Fri, 31 Mar 2000 13:28:29 -0800


I read you could define a ZClass instance's method as a field-index of a
ZCatalog; but it's not working for me.

The DTML method dept_code is simply:

  <dtml-return "_.string.split(jobcode,'-')[0]">

When I call the method directly it returns a single character, the first
character of the jobcode.

The method dept_code is defined as a field-index of the ZCatalog JobsCat.
But when I access JobsCat thus:

 <dtml-in "JobsCat(meta_type='Job Opening', sort_on='dept_code')">
   <li>
   <a href="<dtml-var "JobsCat.getpath(data_record_id_)">">
            (<dtml-var dept_code>) <dtml-var jobcode>: <dtml-var title></a>
 </dtml-in>

the items are not sorted, and dept_code is null.

Can anyone see what I'm doing wrong?

-- Thanks
-- Loren