(self, use_unions, use_joins)
| 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) |
no test coverage detected