Commit 2b7ce4a4 authored by Jérome Perrin's avatar Jérome Perrin

instead of comparing interfaces by name, use Interface.implementedBy. The

later works properly with interfaces inheritance.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44252 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 346085f0
......@@ -719,11 +719,12 @@ class Base( CopyContainer,
security.declarePublic('provides')
def provides(cls, interface_name):
"""
Check if the current class provides a particular interface
Check if the current class provides a particular interface from ERP5Type's
interfaces registry
"""
for interface in implementedBy(cls):
if interface.getName() == interface_name:
return True
interface = getattr(interfaces, interface_name, None)
if interface is not None:
return interface.implementedBy(cls)
return False
provides = classmethod(CachingMethod(provides, 'Base.provides',
cache_factory='erp5_ui_long'))
......
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