[Zope] Ordered Folders - the result
Martijn Pieters
mj@antraciet.nl
Sun, 10 Oct 1999 22:18:25 +0200
At 20:36 10-10-99 , Itamar Shtull-Trauring wrote:
>Here's the working version. I'd be grateful for any comments and bug
>reports.
>
>Description:
>Add a "First" button to folders, so you can select some items and make them
>appear first in the list. Therefore, items in a folder are now displayed by
>order of creation plus whatever changes you made, and not alphabetically as
>before. The code that does this was liberated from the ZClasses Views page
>(manage_first in lib/python/ZClasses/Basic.py).
>
>Potential problems:
>Is the line "self._objects = objects" OK as far as multithreading goes?
>Also, I have no idea if the permissions thing will work. I assume I did it
>right, but who knows.
>
>Attached are a new Folder.py and main.dtml (based off the Zope 2.0.1
>release, not CVS), which need to be put in lib/python/OFS. I don't know how
>to make a patch - could someone tell me the command?
Hmmm.. this might be a bit late, but I thought you where trying to do this
in a ZClass.. you can override the Folder's methods doing just this. Just
define a new manage_main DTML method, add your ordering methods, add some
External Methods to handle the reshuffling, and you'll be fine. Yes,
self._objects = objects is thread-safe, the ZODB takes care of that.
--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| T: +31 35 7502100 F: +31 35 7502111
| mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
---------------------------------------------