MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _validate_version_id

Function _validate_version_id

lib/sqlalchemy/orm/loading.py:1430–1444  ·  view source on GitHub ↗
(mapper, state, dict_, row, getter)

Source from the content-addressed store, hash-verified

1428
1429
1430def _validate_version_id(mapper, state, dict_, row, getter):
1431 if mapper._get_state_attr_by_column(
1432 state, dict_, mapper.version_id_col
1433 ) != getter(row):
1434 raise orm_exc.StaleDataError(
1435 "Instance '%s' has version id '%s' which "
1436 "does not match database-loaded version id '%s'."
1437 % (
1438 state_str(state),
1439 mapper._get_state_attr_by_column(
1440 state, dict_, mapper.version_id_col
1441 ),
1442 getter(row),
1443 )
1444 )
1445
1446
1447def _decorate_polymorphic_switch(

Callers 1

_instanceFunction · 0.85

Calls 2

state_strFunction · 0.85

Tested by

no test coverage detected