'Look for the column referenced by a foreign constraint'

def _lookup_reverse_constraint(self, table_name, column_name=None):

    db_name = self._get_setting('NAME')
    if self.dry_run:
        raise DryRunError('Cannot    get    constraints    for    columns.')
    if (not self._is_valid_cache(db_name, table_name)):
        self.lookup_constraint(db_name, table_name)
    try:
        table = self._reverse_cache[db_name][table_name]
        if (column_name == None):
            return [(y, tuple(y)) for (x, y) in table.items()]
        else:
            return tuple(table[column_name])
    except KeyError:
        return []
