blob: 98d04d94b4bb2d1a0ea356d3488fcb7b31263aec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
from rest_framework.negotiation import BaseContentNegotiation
class IgnoreClientContentNegotiation(BaseContentNegotiation):
def select_parser(self, request, parsers):
"""
Select the first parser in the `.parser_classes` list.
"""
return parsers[0]
def select_renderer(self, request, renderers, format_suffix):
"""
Select the first renderer in the `.renderer_classes` list.
"""
return (renderers[0], renderers[0].media_type)
|