parameters: (
          cls,
          a,
          b,
          ignore_nonexistent_tables=False,
          a_subset=None,
          consider_as_foreign_keys=None,
      )
docstring: create a join condition between two tables or selectables.
  
          e.g.::
  
              join_condition(tablea, tableb)
  
          would produce an expression along the lines of::
  
              tablea.c.id==tableb.c.tablea_id
  
          The join is determined based on the foreign key relationships
          between the two selectables.   If there are multiple ways
          to join, or no way to join, an error is raised.
  
          :param ignore_nonexistent_tables: unused - tables outside of the
           two tables being handled are not considered.
  
          :param a_subset: An optional expression that is a sub-component
           of ``a``.  An attempt will be made to join to just this sub-component
           first before looking at the full ``a`` construct, and if found
           will be successful even if there are other ways to join to ``a``.
           This allows the "right side" of a join to be passed thereby
           providing a "natural join".
docstring_summary: create a join condition between two tables or selectables.
docstring_tokens: create a join condition between two tables or selectables .
function: def _join_condition(
          cls,
          a,
          b,
          ignore_nonexistent_tables=False,
          a_subset=None,
          consider_as_foreign_keys=None,
      ):
          """create a join condition between two tables or selectables.
  
          e.g.::
  
              join_condition(tablea, tableb)
  
          would produce an expression along the lines of::
  
              tablea.c.id==tableb.c.tablea_id
  
          The join is determined based on the foreign key relationships
          between the two selectables.   If there are multiple ways
          to join, or no way to join, an error is raised.
  
          :param ignore_nonexistent_tables: unused - tables outside of the
           two tables being handled are not considered.
  
          :param a_subset: An optional expression that is a sub-component
           of ``a``.  An attempt will be made to join to just this sub-component
           first before looking at the full ``a`` construct, and if found
           will be successful even if there are other ways to join to ``a``.
           This allows the "right side" of a join to be passed thereby
           providing a "natural join".
  
          """
          constraints = cls._joincond_scan_left_right(
              a, a_subset, b, consider_as_foreign_keys
          )
  
          if len(constraints) > 1:
              cls._joincond_trim_constraints(
                  a, b, constraints, consider_as_foreign_keys
              )
  
          if len(constraints) == 0:
              if isinstance(b, FromGrouping):
                  hint = (
                      " Perhaps you meant to convert the right side to a "
                      "subquery using alias()?"
                  )
              else:
                  hint = ""
              raise exc.NoForeignKeysError(
                  "Can't find any foreign key relationships "
                  "between '%s' and '%s'.%s"
                  % (a.description, b.description, hint)
              )
  
          crit = [(x == y) for x, y in list(constraints.values())[0]]
          if len(crit) == 1:
              return crit[0]
          else:
              return and_(*crit)
function_tokens: def _join_condition ( cls , a , b , ignore_nonexistent_tables = False , a_subset = None , consider_as_foreign_keys = None , ) : constraints = cls . _joincond_scan_left_right ( a , a_subset , b , consider_as_foreign_keys ) if len ( constraints ) > 1 : cls . _joincond_trim_constraints ( a , b , constraints , consider_as_foreign_keys ) if len ( constraints ) == 0 : if isinstance ( b , FromGrouping ) : hint = ( " Perhaps you meant to convert the right side to a " "subquery using alias()?" ) else : hint = "" raise exc . NoForeignKeysError ( "Can't find any foreign key relationships " "between '%s' and '%s'.%s" % ( a . description , b . description , hint ) ) crit = [ ( x == y ) for x , y in list ( constraints . values ( ) ) [ 0 ] ] if len ( crit ) == 1 : return crit [ 0 ] else : return and_ ( * crit )