Return True if the given object is a mapped class, :class:`_orm.Mapper`, or :class:`.AliasedClass`.
(entity: Any)
| 464 | |
| 465 | |
| 466 | def _is_mapped_class(entity: Any) -> bool: |
| 467 | """Return True if the given object is a mapped class, |
| 468 | :class:`_orm.Mapper`, or :class:`.AliasedClass`. |
| 469 | """ |
| 470 | |
| 471 | insp = inspection.inspect(entity, False) |
| 472 | return ( |
| 473 | insp is not None |
| 474 | and not insp.is_clause_element |
| 475 | and (insp.is_mapper or insp.is_aliased_class) |
| 476 | ) |
| 477 | |
| 478 | |
| 479 | def _is_aliased_class(entity: Any) -> bool: |
no outgoing calls