MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / setup_mappers

Method setup_mappers

test/orm/test_joins.py:2316–2332  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

2314
2315 @classmethod
2316 def setup_mappers(cls):
2317 parent, child = cls.tables.parent, cls.tables.child
2318
2319 class Parent(cls.Comparable):
2320 pass
2321
2322 class Child(cls.Comparable):
2323 pass
2324
2325 mp = cls.mapper_registry.map_imperatively(Parent, parent)
2326 cls.mapper_registry.map_imperatively(Child, child)
2327
2328 derived = select(child).alias()
2329 npc = aliased(Child, derived)
2330 cls.npc = npc
2331 cls.derived = derived
2332 mp.add_property("npc", relationship(npc))
2333
2334 def test_join_parent_child(self):
2335 Parent = self.classes.Parent

Callers

nothing calls this directly

Calls 6

selectFunction · 0.90
aliasedFunction · 0.90
relationshipFunction · 0.90
map_imperativelyMethod · 0.80
add_propertyMethod · 0.80
aliasMethod · 0.45

Tested by

no test coverage detected