MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / do_init

Method do_init

lib/sqlalchemy/orm/properties.py:313–327  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

311 )
312
313 def do_init(self) -> None:
314 super().do_init()
315
316 if len(self.columns) > 1 and set(self.parent.primary_key).issuperset(
317 self.columns
318 ):
319 util.warn(
320 (
321 "On mapper %s, primary key column '%s' is being combined "
322 "with distinct primary key column '%s' in attribute '%s'. "
323 "Use explicit properties to give each column its own "
324 "mapped attribute name."
325 )
326 % (self.parent, self.columns[1], self.columns[0], self.key)
327 )
328
329 def copy(self) -> ColumnProperty[_T]:
330 return ColumnProperty(

Callers

nothing calls this directly

Calls 2

issupersetMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected