cwvreg.py
changeset 3163 edfe43ceaa35
parent 3072 6fb42c53f6df
parent 3137 5598bec9be7f
child 3185 bd0126d17e83
equal deleted inserted replaced
3090:8184bec7414d 3163:edfe43ceaa35
   144             except KeyError:
   144             except KeyError:
   145                 btype = str(baseschema)
   145                 btype = str(baseschema)
   146             try:
   146             try:
   147                 objects = self[btype]
   147                 objects = self[btype]
   148                 assert len(objects) == 1, objects
   148                 assert len(objects) == 1, objects
   149                 cls = objects[0]
   149                 if btype == etype:
       
   150                     cls = objects[0]
       
   151                 else:
       
   152                     # recurse to ensure issubclass(etype_class('Child'),
       
   153                     #                              etype_class('Parent'))
       
   154                     cls = self.etype_class(btype)
   150                 break
   155                 break
   151             except ObjectNotFound:
   156             except ObjectNotFound:
   152                 pass
   157                 pass
   153         else:
   158         else:
   154             # no entity class for any of the ancestors, fallback to the default
   159             # no entity class for any of the ancestors, fallback to the default