[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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@xxxxxxxxxx
beehive elektronische medien GmbH       http://www.beehive.de
phone: +49 30 847-82 0                  fax: +49 30 847-82 299




_______________________________________________
Zope maillist  -  Zope@xxxxxxxx
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )



This mailing list archive is a service of Copilotco.