'Returns the first alias for this query, after increasing its reference
count.'

def get_initial_alias(self):

    if self.tables:
        alias = self.tables[0]
        self.ref_alias(alias)
    else:
        alias = self.join((None, self.get_meta().db_table, None))
    return alias
