MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / get_property

Method get_property

lib/sqlalchemy/orm/mapper.py:2448–2463  ·  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

2446 return key in self._props
2447
2448 def get_property(
2449 self, key: str, _configure_mappers: bool = False
2450 ) -> MapperProperty[Any]:
2451 """return a MapperProperty associated with the given key."""
2452
2453 if _configure_mappers:
2454 self._check_configure()
2455
2456 try:
2457 return self._props[key]
2458 except KeyError as err:
2459 raise sa_exc.InvalidRequestError(
2460 f"Mapper '{self}' has no property '{key}'. If this property "
2461 "was indicated from other mappers or configure events, ensure "
2462 "registry.configure() has been called."
2463 ) from err
2464
2465 def get_property_by_column(
2466 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