MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _is_mapped_class

Function _is_mapped_class

lib/sqlalchemy/orm/base.py:466–476  ·  view source on GitHub ↗

Return True if the given object is a mapped class, :class:`_orm.Mapper`, or :class:`.AliasedClass`.

(entity: Any)

Source from the content-addressed store, hash-verified

464
465
466def _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
479def _is_aliased_class(entity: Any) -> bool:

Callers 11

_assert_clsMethod · 0.90
_assert_reprMethod · 0.90
_assert_not_initMethod · 0.90
_assert_clsMethod · 0.90
_assert_reprMethod · 0.90
_assert_not_initMethod · 0.90
__init_subclass__Method · 0.85
_declared_mapping_infoFunction · 0.85

Calls

no outgoing calls

Tested by 6

_assert_clsMethod · 0.72
_assert_reprMethod · 0.72
_assert_not_initMethod · 0.72
_assert_clsMethod · 0.72
_assert_reprMethod · 0.72
_assert_not_initMethod · 0.72