[Zope] Ordered Folder not returning contents as ordered

Chris Humphries chumphries@devis.com
Thu, 27 Dec 2001 10:37:17 +0000


i am a dummy, even though i was building the dict in order,
dictionaries by definition dont have order.

Chris Humphries wrote:

> Hello all,
>     Before i start hacking away at Ordered Folder code, can someone
>  please shed light on why, this doesnt work:
> 
> --snip--
>    # aq_parent is there for a reason, and it is reading in the
>    # correct place, that has been verified by it's contents
>    for dir in context.aq_parent.objectValues('Ordered Folder'):
> --snip--
> 
>  The above works in the sence that it does return back every ordered
>  folder in the context there, but they are not in order. the context
>  of where it is reading the objectValues from is in an OrderedFolder.
>  Ex:
> 
>    context_orderedFolder
>         |
>         --- orderedFolder1
>         |
>         --- orderedFolder2
>         |
>         --- orderedFolder3
> 
>  The order that it returns them in is strange in that i dont see a
>  pattern, at least an obvious one. They are not even returned in the
>  order they were created, and I tested with using just a regular
>  Folder and i get back the same exact results. Seems that OrderedFolder
>  is not behaving as ordered. IMO, it should always return its contents
>  as ordered however i reference it.
> 
>  Anyone have advice on something that i may be missing that is obvious,
>  or routes to take on the "correct" method of correcting this before I
>  plunge into the OrderedFolder code and return with a patch?
> 
> thanks,
> Chris Humphries
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> 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 )