[Zope] Find and Catalog

Dieter Maurer dieter@handshake.de
Thu, 27 Jun 2002 20:19:28 +0200


Pascal Samuzeau writes:
Hm, do you have 2 problems?

  1.  a KeyError
  2.  an unexpected search result

Your first problem:
 > I try to Find and Catalog inside the portal_catalog.                  
 > I can't and the error below appears.                                  
 > ...
 > 310, in catalogObject                                                 
 >   File C:\Zope\ZopeSite\lib\python\Products\ZCatalog\Catalog.py, line 
 > 423, in recordify                                                     
 >   File C:\Zope\ZopeSite\lib\python\OFS\DTMLMethod.py, line 120, in    
 > __call__                                                              
 >     (Object: title)                                                   
 >   File C:\Zope\ZopeSite\lib\python\DocumentTemplate\DT_String.py, line
 > 473, in __call__                                                      
 >     (Object: title)                                                   
 >   File C:\Zope\ZopeSite\lib\python\DocumentTemplate\DT_Var.py, line   
 > 211, in render                                                        
 >     (Object: question)                                                
 > KeyError: (see above)                                                 
The "title" field in your catalog's "Meta Data Table" is resolved into
a DTML Method (named "title") for at least one of the objects
to be catalogued.
This DTML Method references a variable "question" which is not
defined in the current context.

It is not a good idea, to name a DTML Method "title".


Your second problem:
 > I tried to do it, because when I use of this syntaxe :                
 >                                                                       
 > <dtml-let results=portal_catalog>                                     
 > <dtml-return search_view>                                             
 > </dtml-let>                                                           
 >                                                                       
 > with param as :                                                       
 >                                                                       
 > Type=Document                                                         
 >                                                                       
 > Zope returns to me ALL the catalog !!!!                               
That is strange (and should not happen).

Apparently, the "portal_catalog" does not see the "Type" in the
REQUEST. You are sure, it is there?


Dieter