Sorry all, 

my mistake! I had a slash after vocabulary below...

Thanks,
Johannes


Am Montag, 2. März 2009 15:39:53 schrieben Sie:
> Hi again,
>
> > > 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
> >
> > The depth argument is being ignored. It is a parameter of the path index:
> >
> > query['path'] = {
> >     'query': '/'.join(self.getPhysicalPath()) + '/vocabulary' }
> >     'depth': 1,
> > }
>
> Thanks for your help! I tried your suggestion like this:
>
>       def get_vocab(self):
>               pc = getToolByName(self, 'portal_catalog')
>               query = {}
>               query['path'] = {'query' : '/'.join(self.getPhysicalPath())
> + '/vocabulary', '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
>
>
> but get no results with this method either... When I omit the "depth"
> paramether, I get results though. So there should be another way?!
>
> Thanks,
> Johannes



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

Reply via email to