

@event.listens_for(PolymorphicVerticalProperty, 'mapper_configured', propagate=True)
def on_new_class(mapper, cls_):
    'Look for Column objects with type info in them, and work up\n    a lookup table.'
    info_dict = {
        
    }
    info_dict[type(None)] = (None, 'none')
    info_dict['none'] = (None, 'none')
    for k in mapper.c.keys():
        col = mapper.c[k]
        if ('type' in col.info):
            (python_type, discriminator) = col.info['type']
            info_dict[python_type] = (k, discriminator)
            info_dict[discriminator] = (k, discriminator)
    cls_.type_map = info_dict

dataset/ETHPy150Open zzzeek/sqlalchemy/examples/vertical/dictlike-polymorphic.py on_new_class/original