Commit 8df1e1ea authored by Nicolas Dumazet's avatar Nicolas Dumazet

prepare accessor generation changes by delaying hashing responsability to the

accessor class instead of spending cycles iterating over all accessor arguments
to convert them ALL to tuples no matter what.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43353 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 81bc7fed
......@@ -61,6 +61,16 @@ class DefaultGetter(BaseGetter):
self._property_type = property_type
self._null = type_definition[property_type]['null']
self._default = default
# These values are hashed by _get*AcquiredProperty: to be
# hashable, they need to be converted to tuples
if isinstance(acquisition_base_category, list):
acquisition_base_category = tuple(acquisition_base_category)
if isinstance(acquisition_object_id, list):
acquisition_object_id = tuple(acquisition_object_id)
if isinstance(acquisition_portal_type, list):
acquisition_portal_type = tuple(acquisition_portal_type)
self._acquisition_base_category = acquisition_base_category
self._acquisition_portal_type = acquisition_portal_type
self._acquisition_accessor_id = acquisition_accessor_id
......@@ -139,6 +149,16 @@ class ListGetter(BaseGetter):
self._property_type = property_type
self._null = type_definition[property_type]['null']
self._default = default
# These values are hashed by _get*AcquiredProperty: to be
# hashable, they need to be converted to tuples
if isinstance(acquisition_base_category, list):
acquisition_base_category = tuple(acquisition_base_category)
if isinstance(acquisition_object_id, list):
acquisition_object_id = tuple(acquisition_object_id)
if isinstance(acquisition_portal_type, list):
acquisition_portal_type = tuple(acquisition_portal_type)
self._acquisition_base_category = acquisition_base_category
self._acquisition_portal_type = acquisition_portal_type
self._acquisition_accessor_id = acquisition_accessor_id
......
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