'Lookup all rows referenced by values.
@param key: the key Field
@param values: the values
@param fields: the fields to retrieve'

def lookup_rows(self, key, values, fields=[]):

    s3db = current.s3db
    table = self.table
    ftable = s3db.cr_shelter_flag
    itable = s3db.cr_shelter_inspection
    utable = s3db.cr_shelter_unit
    left = (ftable.on((ftable.id == table.flag_id)), itable.on((itable.id == table.inspection_id)), utable.on((utable.id == itable.shelter_unit_id)))
    count = len(values)
    if (count == 1):
        query = (table.id == values[0])
    else:
        query = table.id.belongs(values)
    limitby = (0, count)
    rows = current.db(query).select(table.id, utable.name, itable.id, itable.date, ftable.name, left=left, limitby=limitby)
    return rows
