[Zope] Am I doing right?

Jerome Alet alet@librelogiciel.com
Fri, 13 Dec 2002 17:31:38 +0100


On Fri, Dec 13, 2002 at 05:11:16PM +0100, catonano wrote:
> 
> This property is the name of the file BUT the extension, for example:
> 
> code2.html        property:  code2
> code88.html     property: code88

add an index of type FieldIndex to your ZCatalog, name it by the
name you want to search on, e.g. itemcode

create a Script (Python) object named itemcode in your root which 
contains only :

        return context.getId().split('.')[-1]
        
Go to the Advanced tag of your ZCatalog and click Update
Go to the Find tab of your ZCatalog and search for all 
objects you want to add to the ZCatalog

use the ZCatalog like this :

    result = context["Catalog"].searchResults(itemcode='blah')
    
will find all objects which itemcode's value is 'blah'    

this is compltely untested but should work

bye,

Jerome Alet