mirror of
				https://github.com/django/django.git
				synced 2025-10-31 01:25:32 +00:00 
			
		
		
		
	[1.8.x] Corrected indentation of JsonResponse docs.
Backport of 290145e661 from master
			
			
This commit is contained in:
		| @@ -889,29 +889,27 @@ JsonResponse objects | |||||||
|  |  | ||||||
| .. versionadded:: 1.7 | .. versionadded:: 1.7 | ||||||
|  |  | ||||||
| .. class:: JsonResponse | .. class:: JsonResponse(data, encoder=DjangoJSONEncoder, safe=True, **kwargs) | ||||||
|  |  | ||||||
| .. method:: JsonResponse.__init__(data, encoder=DjangoJSONEncoder, safe=True, **kwargs) |     An :class:`HttpResponse` subclass that helps to create a JSON-encoded | ||||||
|  |     response. It inherits most behavior from its superclass with a couple | ||||||
|  |     differences: | ||||||
|  |  | ||||||
|    An :class:`HttpResponse` subclass that helps to create a JSON-encoded |     Its default ``Content-Type`` header is set to ``application/json``. | ||||||
|    response. It inherits most behavior from its superclass with a couple |  | ||||||
|    differences: |  | ||||||
|  |  | ||||||
|    Its default ``Content-Type`` header is set to ``application/json``. |     The first parameter, ``data``, should be a ``dict`` instance. If the | ||||||
|  |     ``safe`` parameter is set to ``False`` (see below) it can be any | ||||||
|  |     JSON-serializable object. | ||||||
|  |  | ||||||
|    The first parameter, ``data``, should be a ``dict`` instance. If the ``safe`` |     The ``encoder``, which defaults to | ||||||
|    parameter is set to ``False`` (see below) it can be any JSON-serializable |     ``django.core.serializers.json.DjangoJSONEncoder``, will be used to | ||||||
|    object. |     serialize the data. See :ref:`JSON serialization | ||||||
|  |     <serialization-formats-json>` for more details about this serializer. | ||||||
|  |  | ||||||
|    The ``encoder``, which defaults to |     The ``safe`` boolean parameter defaults to ``True``. If it's set to | ||||||
|    ``django.core.serializers.json.DjangoJSONEncoder``, will be used to |     ``False``, any object can be passed for serialization (otherwise only | ||||||
|    serialize the data. See :ref:`JSON serialization |     ``dict`` instances are allowed). If ``safe`` is ``True`` and a non-``dict`` | ||||||
|    <serialization-formats-json>` for more details about this serializer. |     object is passed as the first argument, a :exc:`TypeError` will be raised. | ||||||
|  |  | ||||||
|    The ``safe`` boolean parameter defaults to ``True``. If it's set to ``False``, |  | ||||||
|    any object can be passed for serialization (otherwise only ``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. |  | ||||||
|  |  | ||||||
| Usage | Usage | ||||||
| ----- | ----- | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user