Commit fbb01381 authored by Sebastien Robin's avatar Sebastien Robin

define variable instead of accessing many time an attribute in _setProperty

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25483 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 604b51a3
...@@ -1412,13 +1412,14 @@ class Base( CopyContainer, ...@@ -1412,13 +1412,14 @@ class Base( CopyContainer,
return method(value, **kw) return method(value, **kw)
# Try to get a portal_type property (Implementation Dependent) # Try to get a portal_type property (Implementation Dependent)
aq_key = self._aq_key() aq_key = self._aq_key()
if not Base.aq_portal_type.has_key(aq_key): aq_portal_type = Base.aq_portal_type
if not aq_portal_type.has_key(aq_key):
self._aq_dynamic('id') # Make sure _aq_dynamic has been called once self._aq_dynamic('id') # Make sure _aq_dynamic has been called once
if getattr(Base.aq_portal_type[aq_key], accessor_name, None) is not None: if getattr(aq_portal_type[aq_key], accessor_name, None) is not None:
method = getattr(self, accessor_name) method = getattr(self, accessor_name)
# LOG("Base.py", 0, "method = %s, name = %s" %(method, accessor_name)) # LOG("Base.py", 0, "method = %s, name = %s" %(method, accessor_name))
return method(value, **kw) return method(value, **kw)
if getattr(Base.aq_portal_type[aq_key], public_accessor_name, None) is not None: if getattr(aq_portal_type[aq_key], public_accessor_name, None) is not None:
method = getattr(self, public_accessor_name) method = getattr(self, public_accessor_name)
return method(value, **kw) return method(value, **kw)
# Finaly use standard PropertyManager # Finaly use standard PropertyManager
......
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