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 ...@@ -16,14 +16,16 @@ Bugs Fixed
since Python 2.5. This breaks Python 2.4 compatibility when the since Python 2.5. This breaks Python 2.4 compatibility when the
publisher-profile-file configuration option is set. publisher-profile-file configuration option is set.
- Use cProfile where possible for the
Control_Panel/DebugInfo/manage_profile ZMI view.
Features Added 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. - Updated to Zope Toolkit 1.0.1.
- Use cProfile where possible for the
Control_Panel/DebugInfo/manage_profile ZMI view.
Restructuring Restructuring
+++++++++++++ +++++++++++++
......
...@@ -134,12 +134,12 @@ class OrderSupport(object): ...@@ -134,12 +134,12 @@ class OrderSupport(object):
suppress_events=False): suppress_events=False):
""" Move specified sub-objects by delta. """ Move specified sub-objects by delta.
""" """
if type(ids) is str: if isinstance(ids, basestring):
ids = (ids,) ids = (ids,)
min_position = 0 min_position = 0
objects = list(self._objects) objects = list(self._objects)
if subset_ids == None: if subset_ids is None:
subset_ids = [ obj['id'] for obj in objects ] subset_ids = self.getIdsSubset(objects)
else: else:
subset_ids = list(subset_ids) subset_ids = list(subset_ids)
# unify moving direction # unify moving direction
...@@ -283,4 +283,12 @@ class OrderSupport(object): ...@@ -283,4 +283,12 @@ class OrderSupport(object):
r.reverse() r.reverse()
return r return r
#
# Helper methods
#
def getIdsSubset(self, objects):
return [obj['id'] for obj in objects]
InitializeClass(OrderSupport) 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