(self, state)
| 266 | ) |
| 267 | |
| 268 | def _verify_canload(self, state): |
| 269 | if self.prop.uselist and state is None: |
| 270 | raise exc.FlushError( |
| 271 | "Can't flush None value found in " |
| 272 | "collection %s" % (self.prop,) |
| 273 | ) |
| 274 | elif state is not None and not self.mapper._canload( |
| 275 | state, allow_subtypes=not self.enable_typechecks |
| 276 | ): |
| 277 | if self.mapper._canload(state, allow_subtypes=True): |
| 278 | raise exc.FlushError( |
| 279 | "Attempting to flush an item of type " |
| 280 | "%(x)s as a member of collection " |
| 281 | '"%(y)s". Expected an object of type ' |
| 282 | "%(z)s or a polymorphic subclass of " |
| 283 | "this type. If %(x)s is a subclass of " |
| 284 | '%(z)s, configure mapper "%(zm)s" to ' |
| 285 | "load this subtype polymorphically, or " |
| 286 | "set enable_typechecks=False to allow " |
| 287 | "any subtype to be accepted for flush. " |
| 288 | % { |
| 289 | "x": state.class_, |
| 290 | "y": self.prop, |
| 291 | "z": self.mapper.class_, |
| 292 | "zm": self.mapper, |
| 293 | } |
| 294 | ) |
| 295 | else: |
| 296 | raise exc.FlushError( |
| 297 | "Attempting to flush an item of type " |
| 298 | "%(x)s as a member of collection " |
| 299 | '"%(y)s". Expected an object of type ' |
| 300 | "%(z)s or a polymorphic subclass of " |
| 301 | "this type." |
| 302 | % { |
| 303 | "x": state.class_, |
| 304 | "y": self.prop, |
| 305 | "z": self.mapper.class_, |
| 306 | } |
| 307 | ) |
| 308 | |
| 309 | def _synchronize(self, state, child, associationrow, clearkeys, uowcommit): |
| 310 | raise NotImplementedError() |
no test coverage detected