Re: [Repoze-dev] sorting API for repoze.folder?

2011-02-28 Thread Hanno Schlichting
On Mon, Feb 28, 2011 at 10:22 AM, Danny Navarro wrote: > Thanks for your hints. I missed plone.folder, I'll have a careful look > at it before redoing something that has already been done. The plone.folder code is quite complicated, as it supports different ordering strategies per adapter lookup

Re: [Repoze-dev] sorting API for repoze.folder?

2011-02-28 Thread Danny Navarro
Hi Hanno, Thanks for your hints. I missed plone.folder, I'll have a careful look at it before redoing something that has already been done. On Sat, Feb 26, 2011 at 8:28 PM, Hanno Schlichting wrote: > On Fri, Feb 25, 2011 at 3:41 PM, Danny Navarro wrote: >> I also suspect that for folders with l

Re: [Repoze-dev] sorting API for repoze.folder?

2011-02-26 Thread Hanno Schlichting
On Fri, Feb 25, 2011 at 3:41 PM, Danny Navarro wrote: > I also suspect that for folders with lots of items a list for order > may not be the most efficient. What would be the persistent equivalent > to an efficient list with ZODB? An IOBTree? We use a IOBTree in plone.folder for storing the order

[Repoze-dev] sorting API for repoze.folder?

2011-02-25 Thread Danny Navarro
Hi guys, Ideally I would like to be able to do something like this with a repoze Folder: >>> from repoze.folder import Folder >>> class MyFolder(Folder): >>> def __init__(self): >>> Folder.__init__(self) >>> self.sort_key = lambda x: self[x].attr >>> >>> f = MyFolder()