'Custom rows lookup
@param key: the key Field
@param values: the values
@param fields: unused (retained for API compatibility)'

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

    s3db = current.s3db
    htable = s3db.hrm_human_resource
    ptable = s3db.pr_person
    left = ptable.on((ptable.id == htable.person_id))
    count = len(values)
    if (count == 1):
        query = (key == values[0])
    else:
        query = key.belongs(values)
    rows = current.db(query).select(htable.id, htable.job_title_id, htable.organisation_id, htable.type, ptable.first_name, ptable.middle_name, ptable.last_name, limitby=(0, count), left=left)
    self.queries += 1
    types = self.types
    for row in rows:
        types[row['hrm_human_resource.id']] = row['hrm_human_resource.type']
    job_title_id = str(htable.job_title_id)
    job_title_ids = [row[job_title_id] for row in rows]
    if job_title_ids:
        self.job_title_represent.bulk(job_title_ids)
    if current.deployment_settings.get_hrm_show_organisation():
        organisation_id = str(htable.organisation_id)
        organisation_ids = [row[organisation_id] for row in rows]
        if organisation_ids:
            htable.organisation_id.represent.bulk(organisation_ids)
    return rows
