Ordered Folder not returning contents as ordered
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
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 )
Hi all, I have the following problem. In my system, there are authors and viewers. The Authors create articles and can edit them, the viewers only view them. To this rule there is one exception, Viewers can post comments on the articles. These comments are actually coded in the properties of the articles. Giving the Author role permissions on changing the articles and the properties of the articles and the viewers only permission to view the articles gets you quite far. Then I was planning on using proxy roles to help the Viewers comment the articles. One script, PostComment, has a proxy role Author. Now, this works fine, as long as PostComment only calls Zope defined methods. If PostComment calls any method I wrote for my own z-classes and that method calls manage_changeProperties() for example, a security exceptions is thrown. Is this the way it is supposed to be? Why doesn't my z-class defined method inherite the proxy role from PostComment and in what way do the Zope definied methods differ from this pattern? Any help is appreciated. Douwe
Douwe Osinga writes:
... Giving the Author role permissions on changing the articles and the properties of the articles and the viewers only permission to view the articles gets you quite far. Then I was planning on using proxy roles to help the Viewers comment the articles. One script, PostComment, has a proxy role Author. Now, this works fine, as long as PostComment only calls Zope defined methods. If PostComment calls any method I wrote for my own z-classes and that method calls manage_changeProperties() for example, a security exceptions is thrown. From Zope 2.2 on, Proxy Roles are no longer inherited by called Zope objects. Each such object must get its own proxy role...
Dieter
participants (3)
-
Chris Humphries -
Dieter Maurer -
Douwe Osinga