Commit 10bf18ef authored by Sebastien Robin's avatar Sebastien Robin

updated the work done by Romain, so we do not use setValueUids but setXXXValue...

updated the work done by Romain, so we do not use setValueUids but setXXXValue (ex: setDestinationValue) instead


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2689 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b78a4e3
......@@ -278,16 +278,9 @@ class MultiRelationEditor:
relation_setter((), portal_type=self.portal_type)
relation_setter( relation_uid_list , portal_type=self.portal_type)
else:
# if relation_uid_list == []:
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)
# getattr(o, set_method_name)( None )
# else:
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)+'ValueList'
# getattr(o, set_method_name)( relation_object_list )
o._setValueUids(self.base_category, (), portal_type=self.portal_type)
o._setValueUids(self.base_category, relation_uid_list, portal_type=self.portal_type)
# we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)+'ValueList'
getattr(o, set_method_name)( relation_object_list , portal_type=self.portal_type)
else:
# Nothing to do
......
......@@ -265,12 +265,10 @@ class RelationEditor:
relation_setter((), portal_type=self.portal_type)
relation_setter((int(self.uid),), portal_type=self.portal_type)
else:
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)+'Value'
# object = o.portal_catalog.getObject( self.uid )
# getattr(o, set_method_name)( object )
o._setValueUids(self.base_category, (), portal_type=self.portal_type)
o._setValueUids(self.base_category, (int(self.uid),), portal_type=self.portal_type)
# we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)+'Value'
object = o.portal_catalog.getObject( self.uid )
getattr(o, set_method_name)( object,portal_type=self.portal_type )
else:
if self.value == '':
......@@ -279,10 +277,9 @@ class RelationEditor:
relation_setter = getattr(o, self.relation_setter_id)
relation_setter((), portal_type=self.portal_type)
else:
# # XXX we could call a generic method which create the setter method name
# set_method_name = '_set'+convertToUpperCase(self.base_category)
# getattr(o, set_method_name)( None )
o._setValueUids(self.base_category, (), portal_type=self.portal_type)
# we could call a generic method which create the setter method name
set_method_name = '_set'+convertToUpperCase(self.base_category)
getattr(o, set_method_name)( None ,portal_type=self.portal_type)
allow_class(RelationEditor)
......
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