Ticket #18023: simplejson_docs.diff

File simplejson_docs.diff, 6.1 KB (added by Alex Ogier, 12 years ago)
  • new file docs/releases/1.5-alpha-1.txt

    diff --git a/docs/releases/1.5-alpha-1.txt b/docs/releases/1.5-alpha-1.txt
    new file mode 100644
    index 0000000..d9f567d
    - +  
     2Django 1.5 alpha release notes
     5*Jantober -21, 2012*
     7Welcome to Django 1.5 alpha!
     9This is the first in a series of preview/development releases leading up to
     10the eventual release of Django 1.5, scheduled for THE FUTURE. This release is
     11primarily targeted at developers who are interested in trying out new features
     12and testing the Django codebase to help identify and resolve bugs prior to the
     13final 1.5 release.
     15As such, this release is *not* intended for production use, and any such use
     16is discouraged.
     18Django 1.5 alpha includes various `new features`_ and some minor `backwards
     19incompatible changes`_. There are also some features that have been dropped,
     20which are detailed in :doc:`our deprecation plan </internals/deprecation>`,
     21and we've `begun the deprecation process for some features`_.
     23.. _`new features`: `What's new in Django 1.5`_
     24.. _`backwards incompatible changes`: `Backwards incompatible changes in 1.5`_
     25.. _`begun the deprecation process for some features`: `Features deprecated in 1.5`_
     31Python compatibility
     34Django 1.5 has dropped support for Python 2.5. Python 2.6 is now the minimum
     35required Python version. Django is tested and supported on Python 2.6 and
     362.7, and has experimental support for Python 3.
     38This change should affect only a small number of Django users, as most
     39operating-system vendors today are shipping Python 2.6 or newer as their default
     40version. If you're still using Python 2.5, however, you'll need to stick to
     41Django 1.4 until you can upgrade. Per :doc:`our support policy
     42</internals/release-process>`, Django 1.4 will continue to receive security
     43support until the release of Django 1.6.
     45What's new in Django 1.5
     48Nothing yet.
     50Backwards incompatible changes in 1.5
     53This will be the most compatible release ever, so far.
     55Features deprecated in 1.5
     61With the dropping of Python 2.5 support, all supported versions of Python
     62have the ``json`` module in their standard library. This module is actually
     63a version of simplejson distributed by Python, so Django no longer needs
     64to provide any JSON modules. Any use of ``django.utils.simplejson`` can be
     65safely changed to ``json``.
     67``django.contrib.simplejson`` will continue to function until it is removed in
     68version 1.7. It will use simplejson if it
     69can find it on your system and fall back to the
     70json module in the standard library if it cannot. There are no longer any
     71cases where it will fall back to a module provided by Django.
  • docs/releases/index.txt

    diff --git a/docs/releases/index.txt b/docs/releases/index.txt
    index 72b6d8b..1ab7d4d 100644
    a b notes.  
    8181.. toctree::
    8282   :maxdepth: 1
     84   1.5-alpha-1
    8485   1.4-beta-1
    8586   1.4-alpha-1
    8687   1.3-beta-1
  • docs/topics/class-based-views.txt

    diff --git a/docs/topics/class-based-views.txt b/docs/topics/class-based-views.txt
    index 8059ed1..9a472fb 100644
    a b different rendering behavior.  
    496496For example, a simple JSON mixin might look something like this::
     498    import json
    498499    from django import http
    499     from django.utils import simplejson as json
    501501    class JSONResponseMixin(object):
    502502        def render_to_response(self, context):
  • docs/topics/serialization.txt

    diff --git a/docs/topics/serialization.txt b/docs/topics/serialization.txt
    index d7d72ec..ffbf9b1 100644
    a b Identifier Information  
    143143==========  ==============================================================
    144144``xml``     Serializes to and from a simple XML dialect.
    146 ``json``    Serializes to and from JSON_ (using a version of simplejson_
    147             bundled with Django).
     146``json``    Serializes to and from JSON_.
    149148``yaml``    Serializes to YAML (YAML Ain't a Markup Language). This
    150149            serializer is only available if PyYAML_ is installed.
    151150==========  ==============================================================
    153152.. _json: http://json.org/
    154 .. _simplejson: http://undefined.org/python/#simplejson
    155153.. _PyYAML: http://www.pyyaml.org/
    157155Notes for specific serialization formats
    For example::  
    169167    json_serializer = serializers.get_serializer("json")()
    170168    json_serializer.serialize(queryset, ensure_ascii=False, stream=response)
    172 The Django source code includes the simplejson_ module. However, if you're
    173 using Python 2.6 or later (which includes a builtin version of the module), Django will
    174 use the builtin ``json`` module automatically. If you have a system installed
    175 version that includes the C-based speedup extension, or your system version is
    176 more recent than the version shipped with Django (currently, 2.0.7), the
    177 system version will be used instead of the version included with Django.
    179 Be aware that if you're serializing using that module directly, not all Django
    180 output can be passed unmodified to simplejson. In particular, :ref:`lazy
     170Be aware, not all Django output can be passed unmodified
     171to the json serializer. In particular, :ref:`lazy
    181172translation objects <lazy-translations>` need a `special encoder`_ written for
    182173them. Something like this will work::
    184175    from django.utils.functional import Promise
    185176    from django.utils.encoding import force_unicode
    187     class LazyEncoder(simplejson.JSONEncoder):
     178    class LazyEncoder(json.JSONEncoder):
    188179        def default(self, obj):
    189180            if isinstance(obj, Promise):
    190181                return force_unicode(obj)
    191182            return super(LazyEncoder, self).default(obj)
    193 .. _special encoder: http://svn.red-bean.com/bob/simplejson/tags/simplejson-1.7/docs/index.html
     184.. _special encoder: http://docs.python.org/library/json.html#encoders-and-decoders
    195186.. _topics-serialization-natural-keys:
Back to Top