[Zope-CMF] Re: [dev] OrderedContainer and hidden sub-objects

yuppie y.2004_ at wcm-solutions.de
Wed Mar 10 04:00:53 EST 2004


Seb Bacon wrote:
> yuppie wrote:
>> I even think adding an optional 'subset_ids' argument to OrderSupport 
>> in Zope 2.7 could be the way to go. So (in the long run) CMF and Plone 
>> don't have to override moveObjectsByDelta at all.
>> The downside of this: It will make moveObjectsByDelta slower.
> Surely not by very much?  A "move" operation is rarely 
> performance-critical, anyway.

Well. The question is if it scales well. Nested loops over big 
containers might become expensive. But I guess you are right that we 
don't have to care about it.

> How about defining an IMoveableSubobjects interface which Containers may 
> choose to implement?  I mention this because the problem reminds me of 
> Shane's implementation of  versionable subobjects in 
> ZopeVersioningRepository:
> http://tinyurl.com/2wdzh
> Seems like an "adaptable" way of dealing with the problem. *cough*

This approach doesn't convince me. I think the subset is more related to 
the UI (should be identical with the subset the user does see) than 
related to the container.

It's an UI policy decision which sub-objects are visible and if it makes 
sense to allow sorting based on this subset.

> With the (simpler) 'setset_ids' solution, where would you define the 
> subset_ids for a given move operation?

In the script that calls the move method.

e.g. Plone's folder_position.py uses now


with the 'subset_ids' argument the code would look like this:

     subset = [ obj.getId() for obj in context.listFolderContents() ]
     context.moveObjectsUp(id, subset_ids=subset)


More information about the Zope-CMF mailing list