Commit dc03a0be authored by Hanno Schlichting's avatar Hanno Schlichting

Forward ported c118710 from 2.13 branch

parent e125691f
......@@ -16,14 +16,16 @@ Bugs Fixed
since Python 2.5. This breaks Python 2.4 compatibility when the
publisher-profile-file configuration option is set.
- Use cProfile where possible for the
Control_Panel/DebugInfo/manage_profile ZMI view.
Features Added
++++++++++++++
- Moved subset id calculation in `OFS.OrderSupport.moveObjectsByDelta` to a
new helper method, patch by Tom Gross.
- Updated to Zope Toolkit 1.0.1.
- Use cProfile where possible for the
Control_Panel/DebugInfo/manage_profile ZMI view.
Restructuring
+++++++++++++
......
......@@ -134,12 +134,12 @@ class OrderSupport(object):
suppress_events=False):
""" Move specified sub-objects by delta.
"""
if type(ids) is str:
if isinstance(ids, basestring):
ids = (ids,)
min_position = 0
objects = list(self._objects)
if subset_ids == None:
subset_ids = [ obj['id'] for obj in objects ]
if subset_ids is None:
subset_ids = self.getIdsSubset(objects)
else:
subset_ids = list(subset_ids)
# unify moving direction
......@@ -283,4 +283,12 @@ class OrderSupport(object):
r.reverse()
return r
#
# Helper methods
#
def getIdsSubset(self, objects):
return [obj['id'] for obj in objects]
InitializeClass(OrderSupport)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment