[Zope] problem with querying a catalog

Tino Wildenhain tino at wildenhain.de
Thu Aug 26 14:58:23 EDT 2004


Hi, 

Am Do, den 26.08.2004 schrieb Henny van der Linde (zettai) um 20:37:
...
> > >
> > > This DTML works. It get's only the edf objects in the path.
> > >
> > > <dtml-in expr="dfcatalog(meta_type='edf', path='/... )

...

> The python script is in the Zope book while using records.
> However this:
> 
> zcat=container.dfcatalog
> results=zcat({'path' :
> '/avin/literatuur/antroposofische_literatuur/artikelendatabase/ms','meta_typ
> e':'edf'})
> 
> won't work either.

Well. You still use different interfaces :-)

Why not in the python script use _the same_ expression?
After all, its the very same object and so the same
interface like in the DTML example :-))

Python Script: 

results=container.dfcatalog(meta_type='edf',path='/avin/literatuur/antroposofische_literatuur/artikelendatabase/ms')

See the identity? :)

See also Zope Book API description. Or the source of ZCatalog:



625     def searchResults(self, REQUEST=None, used=None, **kw):
626         """Search the catalog
627
628         Search terms can be passed in the REQUEST or as keyword
629         arguments.
630
631         The used argument is now deprecated and ignored
632         """
633
634         return self._catalog.searchResults(REQUEST, used, **kw)
635
636     __call__=searchResults
637
638     def search(
639         self, query_request, sort_index=None, reverse=0,
                  limit=None,merge=1):
640         """Programmatic search interface, use for searching the
            catalog from
641         scripts.
642
643         query_request: Dictionary containing catalog query
644         sort_index:    Name of sort index
645         reverse:       Reverse sort order?
646         limit:         Limit sorted result count (optimization hint)
647         merge:         Return merged results (like searchResults) or
raw
648                        results for later merging.
649         """


Regards
Tino



More information about the Zope mailing list