Edited docs/serialization.txt changes from [6645]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-12-01 16:58:52 +00:00
parent e7bc0f10ac
commit a73588aa58
2 changed files with 3 additions and 8 deletions

View File

@ -696,7 +696,7 @@ filesizeformat.is_safe = True
def pluralize(value, arg=u's'): def pluralize(value, arg=u's'):
""" """
Returns a plural suffix if the value is not 1. By default, 's' is used as Returns a plural suffix if the value is not 1. By default, 's' is used as
the suffix: the suffix:
* If value is 0, vote{{ value|pluralize }} displays "0 votes". * If value is 0, vote{{ value|pluralize }} displays "0 votes".

View File

@ -135,8 +135,8 @@ For example::
json_serializer = serializers.get_serializer("json")() json_serializer = serializers.get_serializer("json")()
json_serializer.serialize(queryset, ensure_ascii=False, stream=response) json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
Django ships with a copy of simplejson_ in the source. Be aware, that if The Django source code includes the simplejson_ module. Be aware that if
you're using that for serializing directly that not all Django output can be you're serializing using that module directly, not all Django output can be
passed unmodified to simplejson. In particular, `lazy translation objects`_ passed unmodified to simplejson. In particular, `lazy translation objects`_
need a `special encoder`_ written for them. Something like this will work:: need a `special encoder`_ written for them. Something like this will work::
@ -151,8 +151,3 @@ need a `special encoder`_ written for them. Something like this will work::
.. _lazy translation objects: ../i18n/#lazy-translation .. _lazy translation objects: ../i18n/#lazy-translation
.. _special encoder: http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.7/docs/index.html .. _special encoder: http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.7/docs/index.html
Writing custom serializers
``````````````````````````
XXX ...