[Zope] Strange For loop with ZCatalog

Pascal Samuzeau samuzeau at oreka.com
Mon Feb 9 09:07:42 EST 2004

For some tests I have done :                                          
- Create about 5000 folders under the Root Zope Site                  
- Inside those folders, I have created about 30 000 objects ( as      
document, just an id, title and a Type).                              
- I've catalogued all inside a catalog named TheCatalog               
I have written just this function, in intend to test my CPU ( that why
I've written it like this):                                           
allobject = context.TheCatalog.searchResults(Type='TypeTest')         
i = 0                                                                 
#for i in range(len(allobject)):                                      
for object in allobject:                                              
 #path = allobject[i].getPath()                                       
 #course = allobject[i][0]                                            
 path = allobject.getPath()                                           
 course = allobject[0]                                                
 thepath = string.split(path,'/')                                     
 lepath  = string.join(thepath[:-1],'/')                              
return "Len: %s and Number parsed: %s" %(i,l)                         
Phase A:                                                              
I have 30 000 objects and the message following:                      
Len: 30000 and Number parsed: 15001                                   
In my catalog: 15000 object only were destroyed. !!!                  
Phase 2:                                                              
I de-comment my comment lines, but I've got the same message.         
I try to understand what it happens, but I can't. Anyone has a        
brillant idea?                                                        
Oreka ! Nous sommes l'internet moins cher !                           
Surfez 25% moins cher avec http://www.oreka.com                       

More information about the Zope mailing list