class documentation

class LoaderStrategy(object):

Known subclasses: sqlalchemy.orm.strategies.AbstractRelationshipLoader, sqlalchemy.orm.strategies.ColumnLoader, sqlalchemy.orm.strategies.DeferredColumnLoader, sqlalchemy.orm.strategies.DoNothingLoader, sqlalchemy.orm.strategies.UninstrumentedColumnLoader

View In Hierarchy

Describe the loading behavior of a StrategizedProperty object.

The LoaderStrategy interacts with the querying process in three ways:

  • it controls the configuration of the InstrumentedAttribute placed on a class to handle the behavior of the attribute. this may involve setting up class-level callable functions to fire off a select operation when the attribute is first accessed (i.e. a lazy load)
  • it processes the QueryContext at statement construction time, where it can modify the SQL statement that is being produced. For example, simple column attributes will add their represented column to the list of selected columns, a joined eager loader may establish join clauses to add to the statement.
  • It produces "row processor" functions at result fetching time. These "row processor" functions populate a particular attribute on a particular mapped instance.
Method __init__ Undocumented
Method __str__ Undocumented
Method create​_row​_processor Establish row processing functions for a given QueryContext.
Method init​_class​_attribute Undocumented
Method setup​_query Establish column and other state for a given QueryContext.
Class Variable __slots__ Undocumented
Instance Variable is​_class​_level Undocumented
Instance Variable key Undocumented
Instance Variable parent Undocumented
Instance Variable parent​_property Undocumented
Instance Variable strategy​_key Undocumented
Instance Variable strategy​_opts Undocumented
def __str__(self):

Undocumented

def create_row_processor(self, context, query_entity, path, loadopt, mapper, result, adapter, populators):

Establish row processing functions for a given QueryContext.

This method fulfills the contract specified by MapperProperty.create_row_processor().

StrategizedProperty delegates its create_row_processor() method directly to this method.

def setup_query(self, compile_state, query_entity, path, loadopt, adapter, **kwargs):

Establish column and other state for a given QueryContext.

This method fulfills the contract specified by MapperProperty.setup().

StrategizedProperty delegates its setup() method directly to this method.

key =

Undocumented

parent =

Undocumented

parent_property =

Undocumented

strategy_key =

Undocumented

strategy_opts =

Undocumented