[Zope3-Users] FieldIndex on boolean field - error
Alek Kowalczyk
thealx at poczta.onet.pl
Wed Mar 28 11:55:28 EDT 2007
Hi,
I'm trying to index a boolean field of some object, to simplify retrieving all
the objects which have some flag turned on.
I am adding in proper place the index:
catalog['anomaly'] = FieldIndex('anomaly', IMyObject)
But then, when I try to get the objects using the following command, I get an
exception. Is FieldIndex able to index bool field? If not, how to create own
index for doing that?
anomalies = catalog.searchResults(anomaly=True)
File "C:\Python24\Lib\site-packages\zope\app\catalog\catalog.py", line 121, in
searchResults
results = self.apply(searchterms)
File "C:\Python24\Lib\site-packages\zope\app\catalog\catalog.py", line 100, in
apply
r = index.apply(index_query)
File "C:\Python24\Lib\site-packages\zope\index\field\index.py", line 99, in apply
if len(query) != 2 or not isinstance(query, tuple):
TypeError: len() of unsized object
More information about the Zope3-users
mailing list