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 - [EMAIL PROTECTED] - phone +49 345 122 9889 7 - fax +49 345 122 9889 1 - zope and plone consulting and development
Description: OpenPGP digital signature
_______________________________________________ Zope3-dev mailing list Zope3email@example.com Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com