mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #25254 -- Added JsonResponse json_dumps_params parameter.
This commit is contained in:
parent
290145e661
commit
d0bd533043
4 changed files with 22 additions and 3 deletions
|
@ -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
|
||||
-----
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue