def community_responsify(schema_class, mimetype):
def view(data, code=<NUM_LIT:200>, headers=None, links_item_factory=None,<EOL>page=None, urlkwargs=None, links_pagination_factory=None):<EOL><INDENT>"""<STR_LIT>"""<EOL>if isinstance(data, Community):<EOL><INDENT>last_modified = data.updated<EOL>response_data = schema_class(<EOL>context=dict(item_links_factory=links_item_factory)<EOL>).dump(data).data<EOL><DEDENT>else:<EOL><INDENT>last_modified = None<EOL>response_data = schema_class(<EOL>context=dict(<EOL>total=data.query.count(),<EOL>item_links_factory=links_item_factory,<EOL>page=page,<EOL>urlkwargs=urlkwargs,<EOL>pagination_links_factory=links_pagination_factory)<EOL>).dump(data.items, many=True).data<EOL><DEDENT>response = current_app.response_class(<EOL>json.dumps(response_data, **_format_args()),<EOL>mimetype=mimetype)<EOL>response.status_code = code<EOL>if last_modified:<EOL><INDENT>response.last_modified = last_modified<EOL><DEDENT>if headers is not None:<EOL><INDENT>response.headers.extend(headers)<EOL><DEDENT>return response<EOL><DEDENT>return view<EOL>
Create a community response serializer.

    :param serializer: Serializer instance.
    :param mimetype: MIME type of response.