def parse_request_includes(cls, request: web.Request) -> RequestIncludes:
"""
Parse compound documents parameters from request query string.
Returns the names of the relationships, which should be included into
the response.
.. code-block:: python3
>>> from aiohttp_json_api.context import JSONAPIContext
>>> from aiohttp.test_utils import make_mocked_request
>>> request = make_mocked_request('GET', '/api/Post?include=author,comments.author,some-field.nested')
>>> JSONAPIContext.parse_request_includes(request)
(('author',), ('comments', 'author'), ('some_field', 'nested'))
:seealso: http://jsonapi.org/format/#fetching-includes
"""
return tuple(
tuple(cls.convert_field_name(p) for p in path.split('.'))
for path in request.query.get('include', '').split(',') if path
)
评论列表
文章目录