----- Original Message -----
From: "Shane Rowatt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 03, 2001 00:54
Subject: [Zope-dev] ZCatalog: path & summary indices not generated
>
> Unfortunately I tried the same with the 'path' index by adding the
following
> to DTMLMethod.py
>
>     def getPath(self):
>          "Get path"
>          return getPath(self)
>
>     def path(self):
>          "Get path"
>          return join(self.getPhysicalPath(), "/")
>
> but the 'path' index only works it is a FieldIndex. When it's a PathIndex
I
> get the value of None for all cataloged items.
>

Shane,

you don't have to provide special path() to your objects. The PathIndex
works
a bit different from the other indexes because it does not look for an
attribute
or method with a name equal to the name of your PathIndex. So how do
PathIndexes work ?

- ZCatalog calls PathIndex.index_object() for all objects to be cataloged.
- index_object() determines the physical path the object and indexes this
result
  inside the PathIndex data structure.

We have not seen necessity to provide support for a user-defined hook. If
you have some
use cases let me know.

Hope this helps ;-)

Andreas


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to