Commit 3f127a96 authored by Sebastien Robin's avatar Sebastien Robin

allow dublication uid if specified


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5002 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 219fbaab
...@@ -937,7 +937,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -937,7 +937,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
""" """
self.catalogObjectList([object]) self.catalogObjectList([object])
def catalogObjectList(self, object_list, method_id_list=None, disable_cache=0): def catalogObjectList(self, object_list, method_id_list=None, disable_cache=0,
allow_duplicate_uid=0):
""" """
Add objects to the Catalog by calling Add objects to the Catalog by calling
all SQL methods and providing needed arguments. all SQL methods and providing needed arguments.
...@@ -998,7 +999,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -998,7 +999,9 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
# Make sure no duplicates - ie. if an object with different path has same uid, we need a new uid # Make sure no duplicates - ie. if an object with different path has same uid, we need a new uid
# This can be very dangerous with relations stored in a category table (CMFCategory) # This can be very dangerous with relations stored in a category table (CMFCategory)
# This is why we recommend completely reindexing subobjects after any change of id # This is why we recommend completely reindexing subobjects after any change of id
catalog_path = self.getPathForUid(uid) catalog_path = None
if not allow_duplicate_uid:
catalog_path = self.getPathForUid(uid)
#LOG('catalogObject', 0, 'uid = %r, catalog_path = %r' % (uid, catalog_path)) #LOG('catalogObject', 0, 'uid = %r, catalog_path = %r' % (uid, catalog_path))
if catalog_path == "reserved": if catalog_path == "reserved":
# Reserved line in catalog table # Reserved line in catalog table
......
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