[Zope] sql like functionality to query zcatalogs
Alec Mitchell
apm13 at columbia.edu
Fri Apr 16 12:05:58 EDT 2004
On Friday 16 April 2004 07:47 am, Joel Jensen wrote:
> Hi all,
>
> This one has been nagging me.
>
> Is there some way to search a zcatalogs indexes using SQL?
>
> I have a few thousand objects that have price scattered throughout a
> site I am building.
> I am looking the price up in a MySQL database based on the objects id.
>
> I am seeking a way of cataloging all the objects ( done ) and search
> that catalog for objects with prices between a certain range.
>
> For example:
> select * from zcatalog where price > 2.5 and price < 2.75
>
> If not sql, which way would be the most simple to do this?
As the above post indicates, there's a lot you can do with standard zope
queries. It is very helpful to learn the full syntax (see the Zope Book).
There is also a product called CatalogQuery which you might find helpful. Its
main advantages are '!='/'not in' operators, and 'or' searches (probably
ZCatalog's biggest limitation). I doubt that it is still compatible with
current zope versions, but it might not be too much trouble to get it working
again:
http://zope.org/Members/Kaivo/CatalogQuery/
Perhaps updating it would be a good way to familiarize yourself with some zope
internals, if you are interested in doing so.
Good Luck,
Alec Mitchell
More information about the Zope
mailing list