use entities found in schema, not in the etypes registry, else we miss entity types which have no specific classes tls-sprint
authorsylvain.thenault@logilab.fr
Wed, 15 Apr 2009 14:06:53 +0200
branchtls-sprint
changeset 1357 e5a97779c7fc
parent 1356 7b4802822f40
child 1358 a7438eb2420c
use entities found in schema, not in the etypes registry, else we miss entity types which have no specific classes
cwvreg.py
--- a/cwvreg.py	Wed Apr 15 14:06:08 2009 +0200
+++ b/cwvreg.py	Wed Apr 15 14:06:53 2009 +0200
@@ -122,11 +122,11 @@
                 return
             # remove vobjects that don't support any available interface
             implemented_interfaces = set()
-            for classes in self.get('etypes', {}).values():
-                for cls in classes:
-                    for iface in cls.__implements__:
-                        implemented_interfaces.update(iface.__mro__)
-                    implemented_interfaces.update(cls.__mro__)
+            for etype in self.schema.entities():
+                cls = self.etype_class(etype)
+                for iface in cls.__implements__:
+                    implemented_interfaces.update(iface.__mro__)
+                implemented_interfaces.update(cls.__mro__)
             for obj, ifaces in self._needs_iface.items():
                 ifaces = frozenset(isinstance(iface, basestring)
                                    and iface in self.schema