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

Method get_property

lib/sqlalchemy/orm/mapper.py:2523–2538  ·  view source on GitHub ↗

return a MapperProperty associated with the given key.

(
        self, key: str, _configure_mappers: bool = False
    )

Source from the content-addressed store, hash-verified

2521 return key in self._props
2522
2523 def get_property(
2524 self, key: str, _configure_mappers: bool = False
2525 ) -> MapperProperty[Any]:
2526 """return a MapperProperty associated with the given key."""
2527
2528 if _configure_mappers:
2529 self._check_configure()
2530
2531 try:
2532 return self._props[key]
2533 except KeyError as err:
2534 raise sa_exc.InvalidRequestError(
2535 f"Mapper '{self}' has no property '{key}'. If this property "
2536 "was indicated from other mappers or configure events, ensure "
2537 "registry.configure() has been called."
2538 ) from err
2539
2540 def get_property_by_column(
2541 self, column: ColumnElement[_T]

Callers 15

for_proxyMethod · 0.80
_get_propertyMethod · 0.80
_value_is_scalarMethod · 0.80
_populate_cacheMethod · 0.80
changedMethod · 0.80
_add_reverse_propertyMethod · 0.80
propsMethod · 0.80
test_cyclicalMethod · 0.80
test_cyclicalMethod · 0.80
_descendants_fixtureMethod · 0.80
_anscestors_fixtureMethod · 0.80

Calls 1

_check_configureMethod · 0.95

Tested by 15

test_cyclicalMethod · 0.64
test_cyclicalMethod · 0.64
_descendants_fixtureMethod · 0.64
_anscestors_fixtureMethod · 0.64
test_local_remoteMethod · 0.64
test_cyclicalMethod · 0.64
test_basicMethod · 0.64
test_propsMethod · 0.64