[Zope] How to search a whole sub-tree?

Steve Spicklemire steve@spvi.com
Sun, 2 Sep 2001 18:03:35 -0500


Hi |G|,

	To my way of thinking you have two reasonable options:

	1) Use 'catalog awareness', or add a method to your objects to 
handle re-indexing the object when changes are made. (recent versions of 
ZCatalog no longer require objects to be uncataloged, and cataloged 
again when they are changed.) It's easy enough to query ZCatalog for 
objects who's numeric properties satisfy a certain condition (see the 
HowTo "Advances ZCatalog Searching" on www.zope.org).

	2) Use ZPatterns and keep your object data in a relational database 
so you can use your old queries but use OO methodologies.

-steve

On Sunday, September 2, 2001, at 05:49 PM, <aaa@simplesky.com> wrote:

> Hi Zopers, I'm a newbie in this great zope world, and I've got
> a question that I'm sure is trivial:
>
> Situation: I have some folders that make up a catalog, and inside
> these folder there are other sub-folders and products.
>
> Problem: How can I find the products that match a particular criteria
> (eg. price<1000)? I know about ZCatalog, but do I have to refresh the
> index every time I change a price? Or do I have to traverse the
> whole catalog tree (deep first search, or similar algorithms)?
> I really hope there's a better way to do that.
>
> I'm still stuck in the relational database kind of thinking, this
> OO database is new to me. But "select * from prod where price<1000"
> would be nice. Nothing that easy with zope?
>
> Thanks in advance
>
> |G|
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )