Commit a77601e9 authored by Julien Muchembled's avatar Julien Muchembled

Make Base.getTypeBasedMethod stop considering meta type as prefix.

Use of meta types is deprecated. Ignoring them makes it possible to optimize
getTypeBasedMethod thanks to portal types as classes.
parent d70587e3
...@@ -2961,16 +2961,14 @@ class Base( CopyContainer, ...@@ -2961,16 +2961,14 @@ class Base( CopyContainer,
try: try:
script = type_base_cache[cache_key] script = type_base_cache[cache_key]
except KeyError: except KeyError:
class_name_list = [portal_type, self.getMetaType()] + \
[base_class.__name__ for base_class in self.__class__.mro()
if issubclass(base_class, Base)]
script_name_end = '_' + method_id script_name_end = '_' + method_id
for script_name_begin in class_name_list: for base_class in self.__class__.mro():
script_id = script_name_begin.replace(' ','') + script_name_end if issubclass(base_class, Base):
script = getattr(self, script_id, None) script_id = base_class.__name__.replace(' ','') + script_name_end
if script is not None: script = getattr(self, script_id, None)
type_base_cache[cache_key] = aq_inner(script) if script is not None:
return script type_base_cache[cache_key] = aq_inner(script)
return script
type_base_cache[cache_key] = None type_base_cache[cache_key] = None
if script is not None: if script is not None:
......
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