Clean up docs and review pull request #384

Spelunking through the issues at the PyCon sprints.
This commit is contained in:
Ned Jackson Lovely 2012-03-12 15:26:05 -04:00
parent cb24646948
commit 09370c3f1c

View file

@ -119,15 +119,16 @@ def jsonify(*args, **kwargs):
.. versionadded:: 0.2 .. versionadded:: 0.2
.. versionadded:: 0.9 .. versionadded:: 0.9
If the argument ``padded`` true than the json object will pad for If the ``padded`` argument is true, the JSON object will be padded
JSONP calls like from jquery. The response mimetype will also change for JSONP calls and the response mimetype will be changed to
to ``text/javascript``. ``text/javascript``. By default, the request arguments ``callback``
and ``jsonp`` will be used as the name for the callback function.
This will work with jQuery and most other JavaScript libraries
by default.
The json object will pad as javascript function with the function name If the ``padded`` argument is a string, jsonify will look for
from the request argument ``callback`` or ``jsonp``. If the argument the request argument with the same name and use that value as the
``padded`` a string jsonify will look for the function name in the callback-function name.
request argument with the name which is equal to ``padded``. Is there
no function name it will fallback and use ``jsonp`` as function name.
""" """
if __debug__: if __debug__:
_assert_have_json() _assert_have_json()