Fixed #25254 -- Added JsonResponse json_dumps_params parameter.

This commit is contained in:
Sambhav Satija 2015-08-12 06:23:26 +05:30 committed by Tim Graham
parent 290145e661
commit d0bd533043
4 changed files with 22 additions and 3 deletions

View file

@ -912,7 +912,7 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in
JsonResponse objects
====================
.. class:: JsonResponse(data, encoder=DjangoJSONEncoder, safe=True, **kwargs)
.. class:: JsonResponse(data, encoder=DjangoJSONEncoder, safe=True, json_dumps_params=None, **kwargs)
An :class:`HttpResponse` subclass that helps to create a JSON-encoded
response. It inherits most behavior from its superclass with a couple
@ -934,6 +934,13 @@ JsonResponse objects
``dict`` instances are allowed). If ``safe`` is ``True`` and a non-``dict``
object is passed as the first argument, a :exc:`TypeError` will be raised.
The ``json_dumps_params`` parameter is a dictionary of keyword arguments
to pass to the ``json.dumps()`` call used to generate the response.
.. versionchanged:: 1.9
The ``json_dumps_params`` argument was added.
Usage
-----