[Zope] Default sort order for objects in objectManagers ??

hans hans@beehive.de
Tue, 07 May 2002 14:57:41 +0100


Max M wrote:

> What decides the default sort order for the values returned when I do a
> "objectIds()" etc?
>
> I cannot find it on either Google or in the source.
>
> It seems that it's sorted in creation order. Is that correct and guaranteed?
>
> regards Max M

Use the source, Luke !
sorry, just scrutuinized Folder (i recommend richters OrderedFolder, download
from iuveno)
The items (in ObjectManager) are added with setattr,
which is an insert into the ObjManagers object dictionary
and relies deeply on the hashing built into python dictionaries.
item retrieval = getattr.
This essentially makes retrieval order close to unpredictable.

It has been suggested that zope 2.6 should have orderedFolders built in.
(i personally would like to have a python ordered_dictionary :-) )
--
-------------------------------------------------------------
Who's got only a hammer sees the world as a nail
hans augustin  (software developer)           hans@beehive.de
beehive elektronische medien GmbH       http://www.beehive.de
phone: +49 30 847-82 0                  fax: +49 30 847-82 299