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

hans hans@beehive.de
Tue, 07 May 2002 15:31:21 +0100


Toby Dickenson wrote:

> On Tue, 07 May 2002 14:57:41 +0100, hans <hans@beehive.de> wrote:
>
> >Use the source, Luke !
>
> Youve just proved that is not always good advice ;-)

very, very, sorry. YOU are right.

>
> >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 also maintains _objects, a tuple. It uses this order, not anything
> derived from __dict__, when computing objectIds etc.
>
> >It has been suggested that zope 2.6 should have orderedFolders built in.
> >(i personally would like to have a python ordered_dictionary :-) )
>
> a BTree?

no, something like OrderedFolder
mostly to fix arbitrary ordering.
a lot of navigation/sitemap tools would be obsoleted or simplified by that


--
-------------------------------------------------------------
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