Commit 3566dfcb authored by Łukasz Nowak's avatar Łukasz Nowak

- use `document' variable instead of python reserved `object'


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26470 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c6343e0
......@@ -44,6 +44,6 @@ class BaseVariantMovementGroup(MovementGroup):
property_dict['_base_category_list'] = category_list
return property_dict
def test(self, object, property_dict, **kw):
def test(self, document, property_dict, **kw):
# This movement group does not affect updating.
return True, {}
......@@ -45,7 +45,7 @@ class CategoryMovementGroup(PropertyMovementGroup):
movement.getPropertyList(prop, None))
return property_dict
def test(self, object, property_dict, property_list=None, **kw):
def test(self, document, property_dict, property_list=None, **kw):
if property_list not in (None, []):
target_property_list = [x for x in self.getTestedPropertyList() \
if x in property_list]
......@@ -53,6 +53,6 @@ class CategoryMovementGroup(PropertyMovementGroup):
target_property_list = self.getTestedPropertyList()
for prop in target_property_list:
if property_dict['%s_list' % prop] != \
sorted(object.getPropertyList(prop, None)):
sorted(document.getPropertyList(prop, None)):
return False, property_dict
return True, property_dict
......@@ -43,10 +43,10 @@ class DayMovementGroup(MovementGroup):
property_dict['stop_date'] = addToDate(start_date, day=1)
return property_dict
def test(self, object, property_dict, **kw):
def test(self, document, property_dict, **kw):
start_date = property_dict['start_date']
stop_date = property_dict['stop_date']
if object.getStartDate() <= start_date < stop_date <= object.getStopDate():
if document.getStartDate() <= start_date < stop_date <= document.getStopDate():
return True, property_dict
else:
return False, property_dict
......
......@@ -52,14 +52,14 @@ class MonthlyRangeMovementGroup(MovementGroup):
property_dict[property_name] = end_of_month
return property_dict
def test(self, object, property_dict, property_list=None, **kw):
def test(self, document, property_dict, property_list=None, **kw):
start_date = property_dict.get('start_date', None)
stop_date = property_dict.get('stop_date', None)
if start_date is None or stop_date is None:
return False, property_dict
target_start_date = object.getProperty('start_date', None)
target_stop_date = object.getProperty('stop_date', None)
target_start_date = document.getProperty('start_date', None)
target_stop_date = document.getProperty('stop_date', None)
if target_start_date is None or target_stop_date is None:
return False, property_dict
......
......@@ -54,7 +54,7 @@ class MovementGroup(XMLObject):
# This method should be defined in sub classes.
raise NotImplementedError
def test(self, object, property_dict, **kw):
def test(self, document, property_dict, **kw):
# This method should be defined in sub classes.
raise NotImplementedError
......
......@@ -39,14 +39,14 @@ class NestedLineMovementGroup(MovementGroup):
def _getPropertyDict(self, movement, **kw):
return {}
def test(self, object, property_dict, property_list=None, **kw):
def test(self, document, property_dict, property_list=None, **kw):
if property_list not in (None, []):
target_property_list = [x for x in self.getTestedPropertyList() \
if x in property_list]
else:
target_property_list = self.getTestedPropertyList()
for prop in target_property_list:
if property_dict[prop] != object.getProperty(prop, None):
if property_dict[prop] != document.getProperty(prop, None):
return False, property_dict
return True, property_dict
......
......@@ -45,8 +45,8 @@ class ParentExplanationMovementGroup(MovementGroup):
property_dict['parent_explanation_value'] = parent_explanation_value
return property_dict
def test(self, object, property_dict, **kw):
if object.getParentExplanationValue() == \
def test(self, document, property_dict, **kw):
if document.getParentExplanationValue() == \
property_dict['parent_explanation_value']:
return True, property_dict
else:
......
......@@ -44,13 +44,13 @@ class PropertyMovementGroup(MovementGroup):
property_dict[prop] = movement.getProperty(prop, None)
return property_dict
def test(self, object, property_dict, property_list=None, **kw):
def test(self, document, property_dict, property_list=None, **kw):
if property_list not in (None, []):
target_property_list = [x for x in self.getTestedPropertyList() \
if x in property_list]
else:
target_property_list = self.getTestedPropertyList()
for prop in target_property_list:
if property_dict[prop] != object.getProperty(prop, None):
if property_dict[prop] != document.getProperty(prop, None):
return False, property_dict
return True, property_dict
......@@ -84,8 +84,8 @@ class QuantitySignMovementGroup(MovementGroup):
[tmp_list[0], {'quantity_sign':0}],
]
def test(self, object, property_dict, **kw):
if object.getQuantitySign() == property_dict['quantity_sign']:
def test(self, document, property_dict, **kw):
if document.getQuantitySign() == property_dict['quantity_sign']:
return True, property_dict
else:
return False, property_dict
......@@ -38,7 +38,7 @@ class SplitMovementGroup(MovementGroup):
def _getPropertyDict(self, movement, **kw):
return {}
def test(self, object, property_dict, **kw):
def test(self, document, property_dict, **kw):
return True, property_dict
def _separate(self, movement_list):
......
......@@ -40,8 +40,8 @@ class TitleMovementGroup(MovementGroup):
property_dict['title'] = self._getTitle(movement)
return property_dict
def test(self, object, property_dict, **kw):
# If title is different, we want to update existing object instead
def test(self, document, property_dict, **kw):
# If title is different, we want to update existing document instead
# of creating a new one.
return True, property_dict
......
......@@ -44,8 +44,8 @@ class VariantMovementGroup(MovementGroup):
property_dict['variation_category_list'] = category_list
return property_dict
def test(self, object, property_dict, **kw):
category_list = object.getVariationCategoryList()
def test(self, document, property_dict, **kw):
category_list = document.getVariationCategoryList()
if category_list is None:
category_list = []
category_list.sort()
......
......@@ -41,9 +41,9 @@ class VariationPropertyMovementGroup(MovementGroup):
def _getPropertyDict(self, movement, **kw):
return {'variation_property_dict':movement.getVariationPropertyDict()}
def test(self, object, property_dict, **kw):
def test(self, document, property_dict, **kw):
updatable = False
variation_property_dict = object.getVariationPropertyDict()
variation_property_dict = document.getVariationPropertyDict()
variation_property_list = variation_property_dict.keys()
if len(variation_property_list) == \
len(property_dict['variation_property_dict']):
......
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