From 9e8d3c513e6072ffd5416a73c5392e4767900739 Mon Sep 17 00:00:00 2001 From: Jean-Paul Smets <jp@nexedi.com> Date: Sun, 8 Feb 2004 19:20:26 +0000 Subject: [PATCH] conflict solved git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@437 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/Document/Folder.py | 10 ++++++---- product/ERP5Type/Utils.py | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/product/ERP5Type/Document/Folder.py b/product/ERP5Type/Document/Folder.py index 734c370e5d..e523636d51 100755 --- a/product/ERP5Type/Document/Folder.py +++ b/product/ERP5Type/Document/Folder.py @@ -60,7 +60,7 @@ class FolderMixIn(ExtensionClass.Base): security.declareObjectProtected(Permissions.View) security.declareProtected(Permissions.AddPortalContent, 'newContent') - def newContent(self, id=None, portal_type=None, id_group=None, default=None, method=None, **kw): + def newContent(self, id=None, portal_type=None, id_group=None, default=None, method=None, commit_transaction=0, flush_activity=1, **kw): """ Creates a new content """ @@ -74,7 +74,8 @@ class FolderMixIn(ExtensionClass.Base): id=new_id, **kw) new_instance = self[new_id] - new_instance.flushActivity(invoke=1) + if flush_activity: new_instance.flushActivity(invoke=1) + if commit_transaction: get_transaction().commit() return new_instance security.declareProtected(Permissions.DeletePortalContent, 'deleteContent') @@ -313,7 +314,7 @@ be a problem).""" update_list += method_message update_list += test_after(object=self.getObject(),REQUEST=REQUEST) - for o in self.contentValues(): + for o in self.objectValues(): # contentValues sometimes fail in BTreeFolder # Test on each sub object if method should be applied if filter(object=o,REQUEST=REQUEST): method_message = method(object=o,REQUEST=REQUEST, **kw) @@ -321,7 +322,8 @@ be a problem).""" update_list += method_message update_list += test_after(o,REQUEST=REQUEST) # And commit subtransaction - get_transaction().commit(1) + #get_transaction().commit(1) + get_transaction().commit() # we may use commit(1) some day XXX # Recursively call recursiveApply if o has a recursiveApply method (not acquired) obase = aq_base(o) if hasattr(obase, 'recursiveApply'): diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py index 8e4606a3b6..4cb9b28d80 100755 --- a/product/ERP5Type/Utils.py +++ b/product/ERP5Type/Utils.py @@ -663,6 +663,7 @@ def createDefaultAccessors(klass, id, prop = None): # Create getters for an acquired property # The base accessor returns the first item in a list # and simulates a simple property + # XXXX Missing Boolean accessor accessor_name = 'get' + UpperCase(id) base_accessor = Acquired.DefaultGetter(accessor_name, id, @@ -1252,13 +1253,13 @@ def createDefaultAccessors(klass, id, prop = None): # First Implementation of Boolean Accessor tester_name = 'is' + UpperCase(id) - tester = Base.Tester(tester_name, id, prop['type'], + tester = Base.Getter(tester_name, id, prop['type'], storage_id = prop.get('storage_id')) if not hasattr(BaseClass, tester_name): setattr(klass, tester_name, tester) klass.security.declareProtected(Permissions.AccessContentsInformation, tester_name) tester_name = '_baseIs' + UpperCase(id) - tester = Base.Tester(tester_name, id, prop['type'], + tester = Base.Getter(tester_name, id, prop['type'], storage_id = prop.get('storage_id')) if not hasattr(BaseClass, tester_name): setattr(klass, tester_name, tester) -- 2.30.9