Commit 5d0a22f7 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Move away recorded properties of a Component from globals.

parent 1f4715f1
...@@ -40,11 +40,6 @@ from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage ...@@ -40,11 +40,6 @@ from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage
from zLOG import LOG, INFO from zLOG import LOG, INFO
_recorded_property_name_tuple = (
'reference',
'version',
'text_content')
from ExtensionClass import ExtensionClass from ExtensionClass import ExtensionClass
from Products.ERP5Type.Utils import convertToUpperCase from Products.ERP5Type.Utils import convertToUpperCase
...@@ -105,7 +100,7 @@ class RecordablePropertyMetaClass(ExtensionClass): ...@@ -105,7 +100,7 @@ class RecordablePropertyMetaClass(ExtensionClass):
getter.__name__ = accessor_name getter.__name__ = accessor_name
return getter return getter
for property_name in _recorded_property_name_tuple: for property_name in dictionary['_recorded_property_name_tuple']:
setter_name = '_set' + convertToUpperCase(property_name) setter_name = '_set' + convertToUpperCase(property_name)
dictionary[setter_name] = setterWrapper(setter_name, property_name) dictionary[setter_name] = setterWrapper(setter_name, property_name)
...@@ -148,6 +143,11 @@ class ComponentMixin(PropertyRecordableMixin, Base): ...@@ -148,6 +143,11 @@ class ComponentMixin(PropertyRecordableMixin, Base):
'Reference', 'Reference',
'TextDocument') 'TextDocument')
_recorded_property_name_tuple = (
'reference',
'version',
'text_content')
_message_reference_not_set = "Reference must be set" _message_reference_not_set = "Reference must be set"
_message_invalid_reference = "Reference cannot end with '_version' or "\ _message_invalid_reference = "Reference cannot end with '_version' or "\
"start with '_' or be equal to find_module or load_module" "start with '_' or be equal to find_module or load_module"
...@@ -241,7 +241,7 @@ class ComponentMixin(PropertyRecordableMixin, Base): ...@@ -241,7 +241,7 @@ class ComponentMixin(PropertyRecordableMixin, Base):
workflow = self.workflow_history['component_validation_workflow'][-1] workflow = self.workflow_history['component_validation_workflow'][-1]
workflow['error_list'] = error_list workflow['error_list'] = error_list
else: else:
for property_name in _recorded_property_name_tuple: for property_name in self._recorded_property_name_tuple:
self.clearRecordedProperty(property_name) self.clearRecordedProperty(property_name)
self.validate() self.validate()
......
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