MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / insert_data

Method insert_data

test/orm/test_selectin_relations.py:4323–4335  ·  view source on GitHub ↗
(cls, connection)

Source from the content-addressed store, hash-verified

4321
4322 @classmethod
4323 def insert_data(cls, connection):
4324 ParentA, ParentB, ChildA, ChildB = cls.classes(
4325 "ParentA", "ParentB", "ChildA", "ChildB"
4326 )
4327 session = Session(connection)
4328 parent_a = ParentA(id=1)
4329 parent_b = ParentB(id=2)
4330 for i in range(10):
4331 parent_a.children.append(ChildA())
4332 parent_b.children.append(ChildB())
4333 session.add_all([parent_a, parent_b])
4334
4335 session.commit()
4336
4337 def test_load_both_wpoly(self):
4338 GenericParent, ParentA, ParentB, ChildA, ChildB = self.classes(

Callers

nothing calls this directly

Calls 8

add_allMethod · 0.95
commitMethod · 0.95
SessionClass · 0.90
ParentAClass · 0.85
ParentBClass · 0.85
ChildAClass · 0.85
ChildBClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected