'Returns the list of tables for SQL queries, like select from ...'

def get_tables(self):

    tables = []
    for leaf in self.result:
        for table in leaf.get_tables():
            if (table not in tables):
                tables.append(table)
    table_name = _quote(self.root_model._table)
    if (table_name not in tables):
        tables.append(table_name)
    return tables
