Hi All,

I have the following code in one of my content types:

        def get_vocab(self):
                pc = getToolByName(self, 'portal_catalog')
                query = {}
                query['path'] = '/'.join(self.getPhysicalPath()) + '/vocabulary'
                query['depth'] = 1
                query['object_provides'] = ICategorizerVocabTerm.__identifier__
                brains = pc.searchResults(**query)
                
                dl = DisplayList()
                for term in brains:
                                dl.add(term['id'], term['Title'])

                return dl

This should return all objects under ./vocabulary providing the 
ICategorizerVocabTerm interface. But I *always* get the "vocabulary" object 
too, because it provides the interface also. It does not make any difference, 
whether I set "depth" to 1, 0 or whatever... Strange! I read in Martins Book, 
that depth=1 should leed to the wanted behaviour, beeing "all *sub*items 
under ./vocabulary that provide ICategorizerVocabTerm, *not* the item 
provided as path" !

What Do I do wrong?

Thank you!

Johannes

*  Plone 3.1.7
* CMF 2.1.1
* Zope (Zope 2.10.6-final, python 2.4.4, linux2)
* Python 2.4.4 (#1, Jan 28 2008, 15:57:09) [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)]
* PIL 1.1.6


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to