'Get the list_fields for this resource
@param key: alternative key for the table configuration
@param id_column: - False to exclude the record ID
- True to include it if it is configured
- 0 to make it the first column regardless
whether it is configured or not'

def list_fields(self, key='list_fields', id_column=0):

    list_fields = self.get_config(key, None)
    if ((not list_fields) and (key != 'list_fields')):
        list_fields = self.get_config('list_fields', None)
    if (not list_fields):
        list_fields = [f.name for f in self.readable_fields()]
    id_field = pkey = self._id.name
    if (self.parent and (not self.link) and (not current.response.s3.component_show_key)):
        fkey = self.fkey
    else:
        fkey = None
    fields = []
    append = fields.append
    selectors = set()
    seen = selectors.add
    for f in list_fields:
        selector = (f[1] if (type(f) is tuple) else f)
        if (fkey and (selector == fkey)):
            continue
        if ((selector == pkey) and (not id_column)):
            id_field = f
        elif (selector not in selectors):
            seen(selector)
            append(f)
    if (id_column is 0):
        fields.insert(0, id_field)
    return fields
