[Zope3-dev] Heads up: bugs in zope.app.catalog?

Christian Theune ct at gocept.com
Fri Nov 17 07:22:42 EST 2006


Hi,

Adam Groszer wrote:
> Hello Christian,
> 
> Yep, but...
> What is the `good` behaviour regarding None values?
> Do we need to catalog them or skip them?
> 
> Example:
> If the object is (user.title == None)
> Shall it be kept in the catalog or not?
> In case it is not in the catalog I won't be able to search for users
> with no title. Suggestions?
> At the moment the AttributeIndex works like this.

Ah, I didn't see that question in your original mail, so you said:

  I found that z.a.catalog, AttributeIndex fails to remove the previous
  value/object from the index IF the new value is None.

From this I derived that removing the value would be the right thing to
do. I didn't see the question about whether to index None or not.

IIRC the FieldIndex in Zope 2 uses None as a valid value to index and to
search for.

If I read the source and tests correctly, it's just an implementation
accident, because someone used None as a getattr() marker instead of
using a unique marker like object().

At least there is no test and no interface description that says that
None should not be indexed.

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20061117/bef0c5a8/signature.bin


More information about the Zope3-dev mailing list