2012-03-30 17:33:51 +08:00
|
|
|
============================================
|
|
|
|
Django 1.5 release notes - UNDER DEVELOPMENT
|
|
|
|
============================================
|
|
|
|
|
|
|
|
These release notes cover the `new features`_, as well
|
|
|
|
as some `backwards incompatible changes`_ you'll want to be aware of
|
|
|
|
when upgrading from Django 1.4 or older versions. We've also dropped some
|
|
|
|
features, which are detailed in :doc:`our deprecation plan
|
|
|
|
</internals/deprecation>`, and we've `begun the deprecation process for some
|
|
|
|
features`_.
|
|
|
|
|
|
|
|
.. _`new features`: `What's new in Django 1.5`_
|
|
|
|
.. _`backwards incompatible changes`: `Backwards incompatible changes in 1.5`_
|
|
|
|
.. _`begun the deprecation process for some features`: `Features deprecated in 1.5`_
|
|
|
|
|
|
|
|
Python compatibility
|
|
|
|
====================
|
|
|
|
|
|
|
|
Django 1.5 has dropped support for Python 2.5. Python 2.6 is now the minimum
|
|
|
|
required Python version. Django is tested and supported on Python 2.6 and
|
|
|
|
2.7.
|
|
|
|
|
|
|
|
This change should affect only a small number of Django users, as most
|
|
|
|
operating-system vendors today are shipping Python 2.6 or newer as their default
|
|
|
|
version. If you're still using Python 2.5, however, you'll need to stick to
|
2012-04-30 02:33:54 +08:00
|
|
|
Django 1.4 until you can upgrade your Python version. Per :doc:`our support policy
|
2012-03-30 17:33:51 +08:00
|
|
|
</internals/release-process>`, Django 1.4 will continue to receive security
|
|
|
|
support until the release of Django 1.6.
|
|
|
|
|
2012-04-30 02:33:54 +08:00
|
|
|
Django 1.5 does not run on Jython, because Jython doesn't currently offer any
|
|
|
|
version compatible with Python 2.6.
|
2012-03-30 17:33:51 +08:00
|
|
|
|
|
|
|
What's new in Django 1.5
|
|
|
|
========================
|
|
|
|
|
2012-05-12 15:24:20 +08:00
|
|
|
Support for saving a subset of model's fields
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
The method :meth:`Model.save() <django.db.models.Model.save()>` has a new
|
|
|
|
keyword argument ``update_fields``. By using this argument it is possible to
|
|
|
|
save only a select list of model's fields. This can be useful for performance
|
|
|
|
reasons or when trying to avoid overwriting concurrent changes.
|
|
|
|
|
|
|
|
See the :meth:`Model.save() <django.db.models.Model.save()>` documentation for
|
|
|
|
more details.
|
|
|
|
|
2012-04-11 04:49:45 +08:00
|
|
|
Minor features
|
|
|
|
~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Django 1.5 also includes several smaller improvements worth noting:
|
|
|
|
|
|
|
|
* The template engine now interprets ``True``, ``False`` and ``None`` as the
|
|
|
|
corresponding Python objects.
|
|
|
|
|
2012-04-29 21:37:23 +08:00
|
|
|
* :mod:`django.utils.timezone` provides a helper for converting aware
|
2012-04-30 02:33:54 +08:00
|
|
|
datetimes between time zones. See :func:`~django.utils.timezone.localtime`.
|
2012-04-29 21:37:23 +08:00
|
|
|
|
2012-05-17 20:03:19 +08:00
|
|
|
* The generic views support OPTIONS requests.
|
|
|
|
|
2012-05-11 04:19:01 +08:00
|
|
|
* In the localflavor for Canada, "pq" was added to the acceptable codes for
|
|
|
|
Quebec. It's an old abbreviation.
|
|
|
|
|
2012-03-30 17:33:51 +08:00
|
|
|
Backwards incompatible changes in 1.5
|
|
|
|
=====================================
|
|
|
|
|
2012-04-14 14:40:20 +08:00
|
|
|
.. warning::
|
|
|
|
|
|
|
|
In addition to the changes outlined in this section, be sure to review the
|
|
|
|
:doc:`deprecation plan </internals/deprecation>` for any features that
|
2012-04-30 02:33:54 +08:00
|
|
|
have been removed. If you haven't updated your code within the
|
2012-04-14 14:40:20 +08:00
|
|
|
deprecation timeline for a given feature, its removal may appear as a
|
|
|
|
backwards incompatible change.
|
|
|
|
|
2012-05-24 19:02:19 +08:00
|
|
|
Context in year archive class-based views
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
For consistency with the other date-based generic views,
|
|
|
|
:class:`~django.views.generic.dates.YearArchiveView` now passes ``year`` in
|
|
|
|
the context as a :class:`datetime.date` rather than a string. If you are
|
|
|
|
using ``{{ year }}`` in your templates, you must replace it with ``{{
|
|
|
|
year|date:"Y" }}``.
|
|
|
|
|
|
|
|
``next_year`` and ``previous_year`` were also added in the context. They are
|
|
|
|
calculated according to ``allow_empty`` and ``allow_future``.
|
|
|
|
|
2012-03-30 17:33:51 +08:00
|
|
|
Features deprecated in 1.5
|
|
|
|
==========================
|
|
|
|
|
2012-04-30 01:58:00 +08:00
|
|
|
``django.utils.simplejson``
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2012-04-30 02:33:54 +08:00
|
|
|
Since Django 1.5 drops support for Python 2.5, we can now rely on the
|
|
|
|
:mod:`json` module being in Python's standard library -- so we've removed
|
|
|
|
our own copy of ``simplejson``. You can safely change any use of
|
|
|
|
:mod:`django.utils.simplejson` to :mod:`json`.
|
2012-04-30 01:58:00 +08:00
|
|
|
|
|
|
|
``itercompat.product``
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
2012-03-31 16:24:29 +08:00
|
|
|
|
|
|
|
The :func:`~django.utils.itercompat.product` function has been deprecated. Use
|
2012-05-24 19:02:19 +08:00
|
|
|
the built-in :func:`itertools.product` instead.
|