MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _column_added_to_pk_constraint

Function _column_added_to_pk_constraint

lib/sqlalchemy/sql/naming.py:175–185  ·  view source on GitHub ↗
(pk_constraint, col)

Source from the content-addressed store, hash-verified

173 PrimaryKeyConstraint, "_sa_event_column_added_to_pk_constraint"
174)
175def _column_added_to_pk_constraint(pk_constraint, col):
176 if pk_constraint._implicit_generated:
177 # only operate upon the "implicit" pk constraint for now,
178 # as we have to force the name to None to reset it. the
179 # "implicit" constraint will only have a naming convention name
180 # if at all.
181 table = pk_constraint.table
182 pk_constraint.name = None
183 newname = _constraint_name_for_table(pk_constraint, table)
184 if newname:
185 pk_constraint.name = newname
186
187
188@event.listens_for(Constraint, "after_parent_attach")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected