Set the given :class:`_orm.Mapper` as the 'inherits' for this :class:`_orm.Mapper`, assuming this :class:`_orm.Mapper` is concrete and does not already have an inherits.
(self, mapper)
| 1372 | ) |
| 1373 | |
| 1374 | def _set_concrete_base(self, mapper): |
| 1375 | """Set the given :class:`_orm.Mapper` as the 'inherits' for this |
| 1376 | :class:`_orm.Mapper`, assuming this :class:`_orm.Mapper` is concrete |
| 1377 | and does not already have an inherits.""" |
| 1378 | |
| 1379 | assert self.concrete |
| 1380 | assert not self.inherits |
| 1381 | assert isinstance(mapper, Mapper) |
| 1382 | self.inherits = mapper |
| 1383 | self.inherits.polymorphic_map.update(self.polymorphic_map) |
| 1384 | self.polymorphic_map = self.inherits.polymorphic_map |
| 1385 | for mapper in self.iterate_to_root(): |
| 1386 | if mapper.polymorphic_on is not None: |
| 1387 | mapper._requires_row_aliasing = True |
| 1388 | self.batch = self.inherits.batch |
| 1389 | for mp in self.self_and_descendants: |
| 1390 | mp.base_mapper = self.inherits.base_mapper |
| 1391 | self.inherits._inheriting_mappers.append(self) |
| 1392 | self.passive_updates = self.inherits.passive_updates |
| 1393 | self._all_tables = self.inherits._all_tables |
| 1394 | |
| 1395 | for key, prop in mapper._props.items(): |
| 1396 | if key not in self._props and not self._should_exclude( |
| 1397 | key, key, local=False, column=None |
| 1398 | ): |
| 1399 | self._adapt_inherited_property(key, prop, False) |
| 1400 | |
| 1401 | def _set_polymorphic_on(self, polymorphic_on): |
| 1402 | self.polymorphic_on = polymorphic_on |
no test coverage detected