'Get the representation functions per fact field
@param layers: the list of layers, tuples (selector, method)'

def _represents(self, layers):

    rfields = self.rfields
    represents = {}
    values = self.values
    for (selector, method) in layers:
        if (selector in represents):
            continue
        rfield = rfields[selector]
        f = rfield.field
        if ((method in ('list', 'count')) and (f is not None) and hasattr(f.represent, 'bulk')):
            all_values = values[(selector, method)]
            if all_values:
                f.represent.bulk(list(s3_flatlist(all_values)))
        has_fk = ((f is not None) and s3_has_foreign_key(f))
        if has_fk:
            represent = (lambda v, f=f: s3_unicode(f.represent(v)))
        else:
            m = self._represent_method(selector)
            represent = (lambda v, m=m: s3_unicode(m(v)))
        represents[selector] = (has_fk, represent)
    return represents
