def _mapper_loads_polymorphically_with(self, mapper, adapter):
    for m2 in (mapper._with_polymorphic_mappers or [mapper]):
        self._polymorphic_adapters[m2] = adapter
        for m in m2.iterate_to_root():
            self._polymorphic_adapters[m.local_table] = adapter
def _mapper_loads_polymorphically_with(self, mapper, adapter):
    for m2 in (mapper._with_polymorphic_mappers or [mapper]):
        self._polymorphic_adapters[m2] = adapter
        for m in m2.iterate_to_root():
            self._polymorphic_adapters[m.local_table] = adapter