Commit 9e8d3c51 authored by Jean-Paul Smets's avatar Jean-Paul Smets

conflict solved


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@437 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a2911db7
...@@ -60,7 +60,7 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -60,7 +60,7 @@ class FolderMixIn(ExtensionClass.Base):
security.declareObjectProtected(Permissions.View) security.declareObjectProtected(Permissions.View)
security.declareProtected(Permissions.AddPortalContent, 'newContent') 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 Creates a new content
""" """
...@@ -74,7 +74,8 @@ class FolderMixIn(ExtensionClass.Base): ...@@ -74,7 +74,8 @@ class FolderMixIn(ExtensionClass.Base):
id=new_id, id=new_id,
**kw) **kw)
new_instance = self[new_id] 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 return new_instance
security.declareProtected(Permissions.DeletePortalContent, 'deleteContent') security.declareProtected(Permissions.DeletePortalContent, 'deleteContent')
...@@ -313,7 +314,7 @@ be a problem).""" ...@@ -313,7 +314,7 @@ be a problem)."""
update_list += method_message update_list += method_message
update_list += test_after(object=self.getObject(),REQUEST=REQUEST) 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 # Test on each sub object if method should be applied
if filter(object=o,REQUEST=REQUEST): if filter(object=o,REQUEST=REQUEST):
method_message = method(object=o,REQUEST=REQUEST, **kw) method_message = method(object=o,REQUEST=REQUEST, **kw)
...@@ -321,7 +322,8 @@ be a problem).""" ...@@ -321,7 +322,8 @@ be a problem)."""
update_list += method_message update_list += method_message
update_list += test_after(o,REQUEST=REQUEST) update_list += test_after(o,REQUEST=REQUEST)
# And commit subtransaction # 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) # Recursively call recursiveApply if o has a recursiveApply method (not acquired)
obase = aq_base(o) obase = aq_base(o)
if hasattr(obase, 'recursiveApply'): if hasattr(obase, 'recursiveApply'):
......
...@@ -663,6 +663,7 @@ def createDefaultAccessors(klass, id, prop = None): ...@@ -663,6 +663,7 @@ def createDefaultAccessors(klass, id, prop = None):
# Create getters for an acquired property # Create getters for an acquired property
# The base accessor returns the first item in a list # The base accessor returns the first item in a list
# and simulates a simple property # and simulates a simple property
# XXXX Missing Boolean accessor
accessor_name = 'get' + UpperCase(id) accessor_name = 'get' + UpperCase(id)
base_accessor = Acquired.DefaultGetter(accessor_name, base_accessor = Acquired.DefaultGetter(accessor_name,
id, id,
...@@ -1252,13 +1253,13 @@ def createDefaultAccessors(klass, id, prop = None): ...@@ -1252,13 +1253,13 @@ def createDefaultAccessors(klass, id, prop = None):
# First Implementation of Boolean Accessor # First Implementation of Boolean Accessor
tester_name = 'is' + UpperCase(id) 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')) storage_id = prop.get('storage_id'))
if not hasattr(BaseClass, tester_name): if not hasattr(BaseClass, tester_name):
setattr(klass, tester_name, tester) setattr(klass, tester_name, tester)
klass.security.declareProtected(Permissions.AccessContentsInformation, tester_name) klass.security.declareProtected(Permissions.AccessContentsInformation, tester_name)
tester_name = '_baseIs' + UpperCase(id) 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')) storage_id = prop.get('storage_id'))
if not hasattr(BaseClass, tester_name): if not hasattr(BaseClass, tester_name):
setattr(klass, tester_name, tester) setattr(klass, tester_name, tester)
......
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