'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
    btable = self.table
    ctable = s3db.transport_border_crossing_country
    left = ctable.on(((ctable.border_crossing_id == btable.id) & (ctable.deleted != True)))
    if (len(values) == 1):
        query = (key == values[0])
    else:
        query = key.belongs(values)
    rows = current.db(query).select(btable.id, btable.name, ctable.country, left=left)
    self.queries += 1
    output = {}
    country_represent = s3db.gis_country_code_represent
    for row in rows:
        country = country_represent(row[ctable.country])
        crossing = row['transport_border_crossing']
        crossing_id = crossing.id
        output_row = output.get(crossing_id)
        if output_row:
            countries = output_row.countries
            countries.append(country)
        else:
            crossing.countries = [country]
            output[crossing_id] = crossing
    return output.values()
