catalog search on a lines property?
Hello all, I'm working with a zclass that has a 'lines' property (for the sake of discussion, it will be called 'listing_cats'). The lines property is a list of numbers (which are id's). I want to go through my Catalog and find all objects that have a list_cats that contains a given id (lets say 4928 for example). For my examples, the id will be called 'current_id'. I've tried two things: #1: set 'listing_cats' to current_id then proceed with the dtml-in Catalog and #2 perform a Catalog.searchResults(listing_cats=current_id) Neither of these worked. I'm using a KeywordIndex on my lines object. I kind of expected #1 not to work, but I am suprised that #2 didn't work. Any ideas on how I can do a search on the lines property like I mentioned? ~Mark
Mark Nenadov wrote at 2003-8-13 08:40 -0400:
I'm working with a zclass that has a 'lines' property (for the sake of discussion, it will be called 'listing_cats').
The lines property is a list of numbers (which are id's). I want to go through my Catalog and find all objects that have a list_cats that contains a given id (lets say 4928 for example). For my examples, the id will be called 'current_id'.
The value maintained in a "lines" property is a sequence (in fact a list). Sequences values call for a "KeywordIndex". Please read the corresponding section in the Zope Book. With a KeywordIndex, your task becomes trivial. Dieter
Dieter, Thanks for the reply. But, I *am* using a KeywordIndex as the last part of my last post stated. I'm going to do some more research about the KeywordIndex, but I think I am using it correctly. ~Mark On Wed, 2003-08-13 at 14:48, Dieter Maurer wrote:
The value maintained in a "lines" property is a sequence (in fact a list). Sequences values call for a "KeywordIndex". Please read the corresponding section in the Zope Book.
With a KeywordIndex, your task becomes trivial.
Dieter
participants (2)
-
Dieter Maurer -
Mark Nenadov