[Zope] Re: problem with querying a catalog

Jonathan Hobbs toolkit at magma.ca
Thu Aug 26 15:17:03 EDT 2004


----- Original Message -----
From: "Henny van der Linde (zettai)" <linde at inline-info.nl>
To: <zope at zope.org>; "Michael Haubenwallner" <michael at d2m.at>
Sent: August 26, 2004 2:35 PM
Subject: Re: [Zope] Re: problem with querying a catalog


>
> ----- Original Message -----
> From: "Michael Haubenwallner" <michael at d2m.at>
> To: <zope at zope.org>
> Sent: Thursday, August 26, 2004 8:37 AM
> Subject: [Zope] Re: problem with querying a catalog
>
>
> > robert rottermann wrote:
> > > you do not indicate whath index to use for the path.
> > > Robert
> > >
> > > Henny van der Linde wrote:
> > >
> > >> Hi,
> > >>
> > >> I have some trouble querying  a catalog.
> > >>
> > >> This DTML works. It get's only the edf objects in the path.
> > >>
> > >> <dtml-in expr="dfcatalog(meta_type='edf',
> > >>
> > >>
> path='/avin/literatuur/antroposofische_literatuur/artikelendatabase/ms')">
> > >>
> > >>         <a href="&dtml-absolute_url;"><dtml-var title></a>
> > >> </dtml-in>
> > >>
> > >> This Python script doesn't work. It returns ALL the edf objects on
the
> > >> site.
> > >>
> > >> zcat=container.dfcatalog
> > >> results=zcat({'query' :
> > >>
>
'/avin/literatuur/antroposofische_literatuur/artikelendatabase/ms','meta_typ
> > >>
> > >> e':'edf'})
> > >>
> >
> > results=zcat({'path' :
> >
>
'/avin/literatuur/antroposofische_literatuur/artikelendatabase/ms','meta_typ
> e':'edf'})
> >
> > should work.
> >
> > Michael
>
> No it doesn't. I tried that before.
>
> Henny

Have you tried:

zcat=container.dfcatalog
results=zcat.searchResults({'path' :
'/avin/literatuur/antroposofische_literatuur/artikelendatabase/ms','meta_typ
e':'edf'})

This assumes that 'zcat' is a ZCatalog and that 'path' and 'meta_type' are
indexes you have set up.

Jonathan




More information about the Zope mailing list