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

Method setup_mappers

test/ext/asyncio/test_session.py:815–831  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

813
814 @classmethod
815 def setup_mappers(cls):
816 User, Address = cls.classes("User", "Address")
817 users, addresses = cls.tables("users", "addresses")
818
819 cls.mapper(
820 User,
821 users,
822 properties={
823 "addresses": relationship(
824 Address, cascade="all, delete-orphan"
825 )
826 },
827 )
828 cls.mapper(
829 Address,
830 addresses,
831 )
832
833 @async_test
834 async def test_delete_w_cascade(self, async_session):

Callers

nothing calls this directly

Calls 2

relationshipFunction · 0.90
mapperMethod · 0.45

Tested by

no test coverage detected