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):
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'):
......
......@@ -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)
......
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