[Zope-dev] Zope 2.7: OrderSupport for ObjectManager
Chris McDonough
chrism@zope.com
05 May 2003 10:52:01 -0400
Looks reasonable...
I'm a bit uncomfortable with the sort-by-subobject-attribute code in
orderObjects (the code that is called when sort order is not
"position").
I'm wondering if a generic "IndexedFolder" implementation might be
better for this behavior, where the user may define one or more indexes
on the container itself. The indexes could named after attributes of
subobjects. The indexes and a sort function for each index would be
maintained on the container, and the API methods objectValues,
objectIds, etc.would consult the indexes to return objects in sorted
order dynamically (as opposed to just returning the presorted list of
_objects, which needs to be manipulated statically after each
insertion).
This might be an argument to ditch the dynamic sorting feature until we
better understand the use cases. That said, the feature isn't exposed
in the mgmt interface, so it might be ok. But if people come to rely on
it, it will be difficult to remove (and will never ever go away).
Just a thought.
- C
On Mon, 2003-05-05 at 07:35, Yuppie wrote:
> Hi!
>
>
> Implementing the OrderedObjectManager proposal, we fleshed it out and
> modified it a bit. I made an initial checkin on a branch which reflects
> our current thinking. So this is your chance to discuss the changes
> before we merge it into the trunk.
>
> The code
> yuppie-ordersupport-branch (Creating the branch went wrong a bit. Please
> just checkout lib/python/AccessControl, lib/python/OFS and
> lib/python/Products/OFSP.)
>
> The original proposal:
> <http://dev.zope.org/Wikis/DevSite/Proposals/OrderedObjectManager>
>
>
> Some key issues:
>
> 1.) OrderSupport is a mixin class for ObjectManager. (using the
> CopySupport / FindSupport / UndoSupport pattern)
>
> 2.) 'Folder (Ordered)' is a 'Folder' with OrderSupport. (using the
> 'Script (Python)' pattern for the meta_type to avoid a name clash with
> the existing OrderedFolder product or names like OrderedFolderLite)
>
> 3.) For the ZMI, we use the same 'main.dtml' as the ObjectManager. This
> way we avoid redundant code and make it easier for products that need to
> change the 'main.dtml'.
>
>
> If there are no objections, I'm going to land this soon.
>
>
> Cheers,
>
> Yuppie
>
>
>
> PS: For API Help, we have to copy (!) the Interface to OFSP/help? Right?
>
>
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )