MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / setup_query

Method setup_query

lib/sqlalchemy/orm/strategies.py:475–524  ·  view source on GitHub ↗
(
        self,
        compile_state,
        query_entity,
        path,
        loadopt,
        adapter,
        column_collection,
        memoized_populators,
        only_load_props=None,
        **kw,
    )

Source from the content-addressed store, hash-verified

473 )
474
475 def setup_query(
476 self,
477 compile_state,
478 query_entity,
479 path,
480 loadopt,
481 adapter,
482 column_collection,
483 memoized_populators,
484 only_load_props=None,
485 **kw,
486 ):
487 if (
488 (
489 compile_state.compile_options._render_for_subquery
490 and self.parent_property._renders_in_subqueries
491 )
492 or (
493 loadopt
494 and set(self.columns).intersection(
495 self.parent._should_undefer_in_wildcard
496 )
497 )
498 or (
499 loadopt
500 and self.group
501 and loadopt.local_opts.get(
502 "undefer_group_%s" % self.group, False
503 )
504 )
505 or (only_load_props and self.key in only_load_props)
506 ):
507 self.parent_property._get_strategy(
508 (("deferred", False), ("instrument", True))
509 ).setup_query(
510 compile_state,
511 query_entity,
512 path,
513 loadopt,
514 adapter,
515 column_collection,
516 memoized_populators,
517 **kw,
518 )
519 elif self.is_class_level:
520 memoized_populators[self.parent_property] = _SET_DEFERRED_EXPIRED
521 elif not self.raiseload:
522 memoized_populators[self.parent_property] = _DEFER_FOR_STATE
523 else:
524 memoized_populators[self.parent_property] = _RAISE_FOR_STATE
525
526 def _load_for_state(self, state, passive):
527 if not state.key:

Callers

nothing calls this directly

Calls 4

_get_strategyMethod · 0.80
intersectionMethod · 0.45
getMethod · 0.45
setup_queryMethod · 0.45

Tested by

no test coverage detected