In my case I've had the need to set `indent=2`, to get a more readable
output, and `separators=(',', ':')` to get the most compact output
possible. Having control over `allow_nan` or `skipkeys` could also be
useful for some.
--
Ticket URL: <https://code.djangoproject.com/ticket/25254>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
A partial workaround for this is to create a custom encoder class that
sets the desired values for `indent` and `separators`, this won't work as
well for other `kwargs` as there are defaults sets in `dumps`.
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:2>
Comment (by timgraham):
Maybe it would make sense to add a parameter: `json_dumps_options=None`
which could be a dictionary of options.
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:3>
* owner: nobody => darkryder
* status: new => assigned
Comment:
Going to add parameter which would take in dictionary and pass `kwargs` as
suggested by timgraham.
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:4>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/5127
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:5>
* stage: Accepted => Ready for checkin
Comment:
Looks okay, pending a few cosmetic issues.
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"d0bd5330432e1dda519ebd89606bd0980a36dcb4" d0bd533]:
{{{
#!CommitTicketReference repository=""
revision="d0bd5330432e1dda519ebd89606bd0980a36dcb4"
Fixed #25254 -- Added JsonResponse json_dumps_params parameter.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25254#comment:7>