Package wsatools :: Package DbConnect :: Module DbSession :: Class Join
[hide private]

Class Join

source code


Defines a database inner join between two or more tables. Use as the table argument value in DbSession.query() type methods or when initialising an SelectSQL object.

Instance Methods [hide private]
 
__init__(self, tables, attributes, subJoin=None)
Defines an SQL inner join between given tables on given attributes.
source code
str
__str__(self)
Returns: The SQL FROM clause for this join.
source code
 
_parseInput(self, tables, attributes)
Parses input tables and attributes to get a useful list of predicates.
source code
 
_setSQL(self, tables, predicates)
Sets the FROM and WHERE SQL statement member variables for this join.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  aliases = None
Dictionary of table names referenced by alias.
  joinCols = ''
Common table commons to join on.
  fromStr = ''
The SQL FROM clause for this join.
  whereStr = ''
Join predicates to append to an SQL WHERE clause.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, tables, attributes, subJoin=None)
(Constructor)

source code 

Defines an SQL inner join between given tables on given attributes.

Parameters:
  • tables (sequence(str) or sequence(tuple)) - Unique set of all tables to be joined on same attribute set. Either just supply table names, or a tuple containing table name and alias, e.g. ["Multiframe", "ProgrammeFrame"] or [("Multiframe", "M1"), ("Multiframe", "M2")].
  • attributes (sequence(str) or str) - Unique attribute set on which to join. If a single join column is required then just a string will do.
  • subJoin (tuple(list(str), str)) - Join additional tables on just the given attribute.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Returns: str
The SQL FROM clause for this join.
Overrides: object.__str__