cwvreg.py
branch3.5
changeset 3137 5598bec9be7f
parent 3071 6ad4e6d4df86
child 3163 edfe43ceaa35
child 3316 c4c07aab1c39
equal deleted inserted replaced
3136:ed303cf3a048 3137:5598bec9be7f
   136             except KeyError:
   136             except KeyError:
   137                 btype = str(baseschema)
   137                 btype = str(baseschema)
   138             try:
   138             try:
   139                 objects = self[btype]
   139                 objects = self[btype]
   140                 assert len(objects) == 1, objects
   140                 assert len(objects) == 1, objects
   141                 cls = objects[0]
   141                 if btype == etype:
       
   142                     cls = objects[0]
       
   143                 else:
       
   144                     # recurse to ensure issubclass(etype_class('Child'),
       
   145                     #                              etype_class('Parent'))
       
   146                     cls = self.etype_class(btype)
   142                 break
   147                 break
   143             except ObjectNotFound:
   148             except ObjectNotFound:
   144                 pass
   149                 pass
   145         else:
   150         else:
   146             # no entity class for any of the ancestors, fallback to the default
   151             # no entity class for any of the ancestors, fallback to the default