class_docstr: A builder object for :class:`.query.Query` objects.
class_docstr_tok: ["A","builder","object","for",":","class",":","`",".query.Query","`","objects","."]
docstr: Used by per-state lazy loaders to add options to the
  "lazy load" query from a parent query.
  
  Creates a cache key based on given load path and query options;
  if a repeatable cache key cannot be generated, the query is
  "spoiled" so that it won't use caching.
docstr_tok: ["Used","by","per-state","lazy","loaders","to","add","options","to","the","''","lazy","load","''","query","from","a","parent","query",".","Creates","a","cache","key","based","on","given","load","path","and","query","options",";","if","a","repeatable","cache","key","can","not","be","generated",",","the","query","is","''","spoiled","''","so","that","it","wo","n't","use","caching","."]
code: def _add_lazyload_options(
      self, options, effective_path, cache_path=None
  ):
      """Used by per-state lazy loaders to add options to the
      "lazy load" query from a parent query.
  
      Creates a cache key based on given load path and query options;
      if a repeatable cache key cannot be generated, the query is
      "spoiled" so that it won't use caching.
  
      """
  
      key = ()
  
      if not cache_path:
          cache_path = effective_path
  
      for opt in options:
          if opt._is_legacy_option or opt._is_compile_state:
              ck = opt._generate_cache_key()
              if ck is None:
                  self.spoil(full=True)
              else:
                  assert not ck[1], (
                      "loader options with variable bound parameters "
                      "not supported with baked queries.  Please "
                      "use new-style select() statements for cached "
                      "ORM queries."
                  )
                  key += ck[0]
  
      self.add_criteria(
          lambda q: q._with_current_path(effective_path).options(
              *options
          ),
          cache_path.path,
          key,
      )
  
imports: import collections.abc
  import logging
  from ..None import exc
  from ..None import util
  from ..orm import exc
  from ..orm.query import Query
  from ..orm.session import Session
  from ..sql import func
  from ..sql import literal_column
  from ..sql import util
label_desc: Use image node_id 14 for calling the BakedQuery obj's underlying member method code with example usage: obj._add_lazyload_options(options, effective_path, cache_path) without return types