Catalog wierdness?
Using: Zope Version (Zope 2.5.1 (source release, python 2.1, linux2), python 2.1.3, linux2) Python Version 2.1.3 (#1, Apr 22 2002, 16:16:34) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-85)] In the catalog, I have a FieldIndex that contains an integer. I want to select all objects where that number is 0 or less. objs=Catalog(number_times_sent=0 ,number_times_sent_usage='range:max' ) However, this returns all items, regardless of the value of number_times_sent. If an object has number_times_sent to 2, and I do this call: objs= Catalog(number_times_sent=1 ,number_times_sent_usage='range:max' ) It works as expected, and that object isn't returned. Also, when number_times_sent is 0, the following does work. objs= Catalog(number_times_sent=0) Since I won't have a negative value, this does what I want. However, number_times_sent is variable, so it would be nice if 'range:max' worked for zero. Is there any logical explanation? Bug? Am I doing something wrong? Thanks, Mark
Hi Mark, There are known bugs in the BTree code in 2.5.1 that could be exposed on range seaches. Just to rule this out, can you do a simple isolated test on Zope 2.6.1 that definitely fails on 2.5.1? If you still see this behavior there, let me know and I will try to find out what's going on. -Casey On Sunday 16 March 2003 05:01 pm, Mark Gibson wrote:
Using: Zope Version (Zope 2.5.1 (source release, python 2.1, linux2), python 2.1.3, linux2) Python Version 2.1.3 (#1, Apr 22 2002, 16:16:34) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-85)]
In the catalog, I have a FieldIndex that contains an integer. I want to select all objects where that number is 0 or less.
objs=Catalog(number_times_sent=0 ,number_times_sent_usage='range:max' )
However, this returns all items, regardless of the value of number_times_sent. If an object has number_times_sent to 2, and I do this call:
objs= Catalog(number_times_sent=1 ,number_times_sent_usage='range:max' )
It works as expected, and that object isn't returned. Also, when number_times_sent is 0, the following does work.
objs= Catalog(number_times_sent=0)
Since I won't have a negative value, this does what I want. However, number_times_sent is variable, so it would be nice if 'range:max' worked for zero.
Is there any logical explanation? Bug? Am I doing something wrong?
Thanks, Mark
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Casey Duncan -
mark@dimensional.com