Commit ba0fd479 authored by Vincent Pelletier's avatar Vincent Pelletier

CopySupport: Make is_indexable 3-states.

Consistently with newContent/constructInstance, caller may request one of
three choices:
- do not override class choice
- override class choice, making instance non-indexable
- override class choice, making instance indexable
So is_indexable now defaults to None instead of True.
parent f96752f6
......@@ -426,7 +426,7 @@ class CopyContainer:
_, result = self.__duplicate(
cp,
duplicate=True,
is_indexable=True,
is_indexable=None,
)
return result
......@@ -490,7 +490,7 @@ class CopyContainer:
new_id = self._get_id(orig_id)
result.append({'id': orig_id, 'new_id': new_id})
new_ob._setId(new_id)
if not is_indexable:
if is_indexable is not None and not is_indexable:
new_ob._setNonIndexable()
self._setObject(new_id, new_ob, set_owner=set_owner)
new_ob = self._getOb(new_id)
......@@ -531,7 +531,7 @@ class CopyContainer:
self.isIndexable = ConstantGetter('isIndexable', value=False)
self.__recurse('_setNonIndexable')
def manage_pasteObjects(self, cb_copy_data=None, is_indexable=True, REQUEST=None):
def manage_pasteObjects(self, cb_copy_data=None, is_indexable=None, REQUEST=None):
"""Paste previously copied objects into the current object.
If calling manage_pasteObjects from python code, pass the result of a
......
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