I have a ZCatalog and in the ZMI 'Catalog' tab it reports:

The catalog "Catalog" contains 1,820 record(s) in the path "/".


There is a fieldIndex called 'id' and it has 1842 entries (ZMI -> Catalog -> Indexes tab)


The following python script:

sRes = context.Contacts.Catalog()
print 'len(sRes)= ', len(sRes)
cnt=0
for aRec in sRes:
  cnt+=1
print 'cnt= ', cnt
return printed


Returns:

len(sRes)=  1820
cnt=  1842


There are 1842 data records, so there should be 1842 entries in the ZCatalog.

It looks like the __len__ method in Catalog.py is not returning the correct value - it returns self._length() which is set by the following method (also in Catalog.py):

   def migrate__len__(self):
       """ migration of old __len__ magic for Zope 2.8 """
       if not hasattr(self, '_length'):
           n = self.__dict__['__len__']()
           del self.__dict__['__len__']
           self._length = BTrees.Length.Length(n)

I really don't understand this level of Zope magic, so it is possible that I am not looking in the right place, so any and all ideas/comments/suggestions are appreciated!

Jonathan


Zope 2.9.4
Python 2.4.3
Red Hat Linux 3.2.3-56
_______________________________________________
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 )

Reply via email to