def _get_list_related_field(<EOL>self, field, filter_rel_field, page=None, page_size=None<EOL>):
ret = list()<EOL>if isinstance(field, Related) or isinstance(field, RelatedList):<EOL><INDENT>datamodel = self.datamodel.get_related_interface(field.name)<EOL>filters = datamodel.get_filters(datamodel.get_search_columns_list())<EOL>page, page_size = self._sanitize_page_args(page, page_size)<EOL>order_field = self.order_rel_fields.get(field.name)<EOL>if order_field:<EOL><INDENT>order_column, order_direction = order_field<EOL><DEDENT>else:<EOL><INDENT>order_column, order_direction = "<STR_LIT>", "<STR_LIT>"<EOL><DEDENT>if filter_rel_field:<EOL><INDENT>filters = filters.add_filter_list(filter_rel_field)<EOL><DEDENT>count, values = datamodel.query(<EOL>filters, order_column, order_direction, page=page, page_size=page_size<EOL>)<EOL>for value in values:<EOL><INDENT>ret.append({"<STR_LIT:id>": datamodel.get_pk_value(value), "<STR_LIT:value>": str(value)})<EOL><DEDENT><DEDENT>return count, ret<EOL>
Return a list of values for a related field

:param field: Marshmallow field
:param filter_rel_field: Filters for the related field
:param page: The page index
:param page_size: The page size
:return: (int, list) total record count and list of dict with id and value