'Lookup all rows referenced by values.
(in foreign key representations)
@param key: the key Field
@param values: the values
@param fields: the fields to retrieve'

def lookup_rows(self, key, values, fields=None):

    table = self.table
    organisation_id = self.organisation_id
    if (len(values) == 1):
        query = (key == values[0])
    else:
        query = key.belongs(values)
    rows = current.db(query).select(key, table.name, table.organisation_id)
    new_rows = []
    append = new_rows.append
    for row in rows:
        new_row = {key: row.id}
        if (row.organisation_id == organisation_id):
            new_row['name'] = row.name
        else:
            new_row['name'] = None
        append(new_row)
    self.queries += 1
    return new_rows
