'Defines a relation between two tables in the database.
When executing a table query, fields from the linked table will also be available
(to disambiguate between field names, use table.field_name).'

def link(self, table1, field1, table2, field2, join='left'):

    if isinstance(table1, Table):
        table1 = table1.name
    if isinstance(table2, Table):
        table2 = table2.name
    self.relations.append((table1, field1, table2, field2, join))
