represent a standalone '*' load operation
| 1335 | |
| 1336 | |
| 1337 | class _WildcardLoad(_AbstractLoad): |
| 1338 | """represent a standalone '*' load operation""" |
| 1339 | |
| 1340 | __slots__ = ("strategy", "path", "local_opts") |
| 1341 | |
| 1342 | _traverse_internals = [ |
| 1343 | ("strategy", visitors.ExtendedInternalTraversal.dp_plain_obj), |
| 1344 | ("path", visitors.ExtendedInternalTraversal.dp_plain_obj), |
| 1345 | ( |
| 1346 | "local_opts", |
| 1347 | visitors.ExtendedInternalTraversal.dp_string_multi_dict, |
| 1348 | ), |
| 1349 | ] |
| 1350 | cache_key_traversal: _CacheKeyTraversalType = None |
| 1351 | |
| 1352 | strategy: Optional[Tuple[Any, ...]] |
| 1353 | local_opts: _OptsType |
| 1354 | path: Union[Tuple[()], Tuple[str]] |
| 1355 | propagate_to_loaders = False |
| 1356 | |
| 1357 | def __init__(self) -> None: |
| 1358 | self.path = () |
| 1359 | self.strategy = None |
| 1360 | self.local_opts = util.EMPTY_DICT |
| 1361 | |
| 1362 | def _clone_for_bind_strategy( |
| 1363 | self, |
| 1364 | attrs, |
| 1365 | strategy, |
| 1366 | wildcard_key, |
| 1367 | opts=None, |
| 1368 | attr_group=None, |
| 1369 | propagate_to_loaders=True, |
| 1370 | reconcile_to_other=None, |
| 1371 | extra_criteria=None, |
| 1372 | ): |
| 1373 | assert attrs is not None |
| 1374 | attr = attrs[0] |
| 1375 | assert ( |
| 1376 | wildcard_key |
| 1377 | and isinstance(attr, str) |
| 1378 | and attr in (_WILDCARD_TOKEN, _DEFAULT_TOKEN) |
| 1379 | ) |
| 1380 | |
| 1381 | attr = f"{wildcard_key}:{attr}" |
| 1382 | |
| 1383 | self.strategy = strategy |
| 1384 | self.path = (attr,) |
| 1385 | if opts: |
| 1386 | self.local_opts = util.immutabledict(opts) |
| 1387 | |
| 1388 | assert extra_criteria is None |
| 1389 | |
| 1390 | def options(self, *opts: _AbstractLoad) -> Self: |
| 1391 | raise NotImplementedError("Star option does not support sub-options") |
| 1392 | |
| 1393 | def _apply_to_parent(self, parent: Load) -> None: |
| 1394 | """apply this :class:`_orm._WildcardLoad` object as a sub-option of |
no outgoing calls
no test coverage detected