MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _setup_mapping

Method _setup_mapping

test/orm/inheritance/test_magazine.py:176–353  ·  view source on GitHub ↗
(self, use_unions, use_joins)

Source from the content-addressed store, hash-verified

174 return pub
175
176 def _setup_mapping(self, use_unions, use_joins):
177 (
178 Publication,
179 Issue,
180 Location,
181 LocationName,
182 PageSize,
183 Magazine,
184 Page,
185 MagazinePage,
186 ClassifiedPage,
187 ) = self.classes(
188 "Publication",
189 "Issue",
190 "Location",
191 "LocationName",
192 "PageSize",
193 "Magazine",
194 "Page",
195 "MagazinePage",
196 "ClassifiedPage",
197 )
198 self.mapper_registry.map_imperatively(
199 Publication, self.tables.publication
200 )
201
202 self.mapper_registry.map_imperatively(
203 Issue,
204 self.tables.issue,
205 properties={
206 "publication": relationship(
207 Publication,
208 backref=backref("issues", cascade="all, delete-orphan"),
209 )
210 },
211 )
212
213 self.mapper_registry.map_imperatively(
214 LocationName, self.tables.location_name
215 )
216
217 self.mapper_registry.map_imperatively(
218 Location,
219 self.tables.location,
220 properties={
221 "issue": relationship(
222 Issue,
223 backref=backref(
224 "locations",
225 lazy="joined",
226 cascade="all, delete-orphan",
227 ),
228 ),
229 "name": relationship(LocationName),
230 },
231 )
232
233 self.mapper_registry.map_imperatively(PageSize, self.tables.page_size)

Callers 1

Calls 9

relationshipFunction · 0.90
backrefFunction · 0.90
polymorphic_unionFunction · 0.90
map_imperativelyMethod · 0.80
joinMethod · 0.45
subqueryMethod · 0.45
whereMethod · 0.45
selectMethod · 0.45
outerjoinMethod · 0.45

Tested by

no test coverage detected