|
|
@ -79,9 +79,9 @@ location of tests. The previous runner
|
|
|
|
:setting:`INSTALLED_APPS`.
|
|
|
|
:setting:`INSTALLED_APPS`.
|
|
|
|
|
|
|
|
|
|
|
|
The new runner (``django.test.runner.DiscoverRunner``) uses the test discovery
|
|
|
|
The new runner (``django.test.runner.DiscoverRunner``) uses the test discovery
|
|
|
|
features built into unittest2 (the version of unittest in the Python 2.7+
|
|
|
|
features built into ``unittest2`` (the version of ``unittest`` in the
|
|
|
|
standard library, and bundled with Django). With test discovery, tests can be
|
|
|
|
Python 2.7+ standard library, and bundled with Django). With test discovery,
|
|
|
|
located in any module whose name matches the pattern ``test*.py``.
|
|
|
|
tests can be located in any module whose name matches the pattern ``test*.py``.
|
|
|
|
|
|
|
|
|
|
|
|
In addition, the test labels provided to ``./manage.py test`` to nominate
|
|
|
|
In addition, the test labels provided to ``./manage.py test`` to nominate
|
|
|
|
specific tests to run must now be full Python dotted paths (or directory
|
|
|
|
specific tests to run must now be full Python dotted paths (or directory
|
|
|
@ -111,7 +111,7 @@ Django 1.6 adds support for savepoints in SQLite, with some :ref:`limitations
|
|
|
|
``BinaryField`` model field
|
|
|
|
``BinaryField`` model field
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
A new :class:`django.db.models.BinaryField` model field allows to store raw
|
|
|
|
A new :class:`django.db.models.BinaryField` model field allows storage of raw
|
|
|
|
binary data in the database.
|
|
|
|
binary data in the database.
|
|
|
|
|
|
|
|
|
|
|
|
GeoDjango form widgets
|
|
|
|
GeoDjango form widgets
|
|
|
@ -127,13 +127,13 @@ Minor features
|
|
|
|
* Authentication backends can raise ``PermissionDenied`` to immediately fail
|
|
|
|
* Authentication backends can raise ``PermissionDenied`` to immediately fail
|
|
|
|
the authentication chain.
|
|
|
|
the authentication chain.
|
|
|
|
|
|
|
|
|
|
|
|
* The HttpOnly flag can be set on the CSRF cookie with
|
|
|
|
* The ``HttpOnly`` flag can be set on the CSRF cookie with
|
|
|
|
:setting:`CSRF_COOKIE_HTTPONLY`.
|
|
|
|
:setting:`CSRF_COOKIE_HTTPONLY`.
|
|
|
|
|
|
|
|
|
|
|
|
* The ``assertQuerysetEqual()`` now checks for undefined order and raises
|
|
|
|
* The :meth:`~django.test.TransactionTestCase.assertQuerysetEqual` now checks
|
|
|
|
``ValueError`` if undefined order is spotted. The order is seen as
|
|
|
|
for undefined order and raises :exc:`~exceptions.ValueError` if undefined
|
|
|
|
undefined if the given ``QuerySet`` isn't ordered and there are more than
|
|
|
|
order is spotted. The order is seen as undefined if the given ``QuerySet``
|
|
|
|
one ordered values to compare against.
|
|
|
|
isn't ordered and there are more than one ordered values to compare against.
|
|
|
|
|
|
|
|
|
|
|
|
* Added :meth:`~django.db.models.query.QuerySet.earliest` for symmetry with
|
|
|
|
* Added :meth:`~django.db.models.query.QuerySet.earliest` for symmetry with
|
|
|
|
:meth:`~django.db.models.query.QuerySet.latest`.
|
|
|
|
:meth:`~django.db.models.query.QuerySet.latest`.
|
|
|
@ -146,10 +146,10 @@ Minor features
|
|
|
|
* The default widgets for :class:`~django.forms.EmailField`,
|
|
|
|
* The default widgets for :class:`~django.forms.EmailField`,
|
|
|
|
:class:`~django.forms.URLField`, :class:`~django.forms.IntegerField`,
|
|
|
|
:class:`~django.forms.URLField`, :class:`~django.forms.IntegerField`,
|
|
|
|
:class:`~django.forms.FloatField` and :class:`~django.forms.DecimalField` use
|
|
|
|
:class:`~django.forms.FloatField` and :class:`~django.forms.DecimalField` use
|
|
|
|
the new type attributes available in HTML5 (type='email', type='url',
|
|
|
|
the new type attributes available in HTML5 (``type='email'``, ``type='url'``,
|
|
|
|
type='number'). Note that due to erratic support of the ``number`` input type
|
|
|
|
``type='number'``). Note that due to erratic support of the ``number``
|
|
|
|
with localized numbers in current browsers, Django only uses it when numeric
|
|
|
|
input type with localized numbers in current browsers, Django only uses it
|
|
|
|
fields are not localized.
|
|
|
|
when numeric fields are not localized.
|
|
|
|
|
|
|
|
|
|
|
|
* The ``number`` argument for :ref:`lazy plural translations
|
|
|
|
* The ``number`` argument for :ref:`lazy plural translations
|
|
|
|
<lazy-plural-translations>` can be provided at translation time rather than
|
|
|
|
<lazy-plural-translations>` can be provided at translation time rather than
|
|
|
@ -185,19 +185,21 @@ Minor features
|
|
|
|
* The jQuery library embedded in the admin has been upgraded to version 1.9.1.
|
|
|
|
* The jQuery library embedded in the admin has been upgraded to version 1.9.1.
|
|
|
|
|
|
|
|
|
|
|
|
* Syndication feeds (:mod:`django.contrib.syndication`) can now pass extra
|
|
|
|
* Syndication feeds (:mod:`django.contrib.syndication`) can now pass extra
|
|
|
|
context through to feed templates using a new `Feed.get_context_data()`
|
|
|
|
context through to feed templates using a new
|
|
|
|
callback.
|
|
|
|
:meth:`Feed.get_context_data()
|
|
|
|
|
|
|
|
<django.contrib.syndication.Feed.get_context_data>` callback.
|
|
|
|
|
|
|
|
|
|
|
|
* The admin list columns have a ``column-<field_name>`` class in the HTML
|
|
|
|
* The admin list columns have a ``column-<field_name>`` class in the HTML
|
|
|
|
so the columns header can be styled with CSS, e.g. to set a column width.
|
|
|
|
so the columns header can be styled with CSS, e.g. to set a column width.
|
|
|
|
|
|
|
|
|
|
|
|
* The isolation level can be customized under PostgreSQL.
|
|
|
|
* The :ref:`isolation level<database-isolation-level>` can be customized under
|
|
|
|
|
|
|
|
PostgreSQL.
|
|
|
|
|
|
|
|
|
|
|
|
* The :ttag:`blocktrans` template tag now respects
|
|
|
|
* The :ttag:`blocktrans` template tag now respects
|
|
|
|
:setting:`TEMPLATE_STRING_IF_INVALID` for variables not present in the
|
|
|
|
:setting:`TEMPLATE_STRING_IF_INVALID` for variables not present in the
|
|
|
|
context, just like other template constructs.
|
|
|
|
context, just like other template constructs.
|
|
|
|
|
|
|
|
|
|
|
|
* SimpleLazyObjects will now present more helpful representations in shell
|
|
|
|
* ``SimpleLazyObject``\s will now present more helpful representations in shell
|
|
|
|
debugging situations.
|
|
|
|
debugging situations.
|
|
|
|
|
|
|
|
|
|
|
|
* Generic :class:`~django.contrib.gis.db.models.GeometryField` is now editable
|
|
|
|
* Generic :class:`~django.contrib.gis.db.models.GeometryField` is now editable
|
|
|
@ -210,7 +212,7 @@ Minor features
|
|
|
|
* The documentation contains a :doc:`deployment checklist
|
|
|
|
* The documentation contains a :doc:`deployment checklist
|
|
|
|
</howto/deployment/checklist>`.
|
|
|
|
</howto/deployment/checklist>`.
|
|
|
|
|
|
|
|
|
|
|
|
* The :djadmin:`diffsettings` comand gained a ``--all`` option.
|
|
|
|
* The :djadmin:`diffsettings` command gained a ``--all`` option.
|
|
|
|
|
|
|
|
|
|
|
|
* ``django.forms.fields.Field.__init__`` now calls ``super()``, allowing
|
|
|
|
* ``django.forms.fields.Field.__init__`` now calls ``super()``, allowing
|
|
|
|
field mixins to implement ``__init__()`` methods that will reliably be
|
|
|
|
field mixins to implement ``__init__()`` methods that will reliably be
|
|
|
@ -241,17 +243,19 @@ Minor features
|
|
|
|
* The ``choices`` argument to model fields now accepts an iterable of iterables
|
|
|
|
* The ``choices`` argument to model fields now accepts an iterable of iterables
|
|
|
|
instead of requiring an iterable of lists or tuples.
|
|
|
|
instead of requiring an iterable of lists or tuples.
|
|
|
|
|
|
|
|
|
|
|
|
* The reason phrase can be customized in HTTP responses.
|
|
|
|
* The reason phrase can be customized in HTTP responses using
|
|
|
|
|
|
|
|
:attr:`~django.http.HttpResponse.reason_phrase`.
|
|
|
|
|
|
|
|
|
|
|
|
* When giving the URL of the next page for :func:`~django.contrib.auth.views.logout`,
|
|
|
|
* When giving the URL of the next page for
|
|
|
|
|
|
|
|
:func:`~django.contrib.auth.views.logout`,
|
|
|
|
:func:`~django.contrib.auth.views.password_reset`,
|
|
|
|
:func:`~django.contrib.auth.views.password_reset`,
|
|
|
|
:func:`~django.contrib.auth.views.password_reset_confirm`,
|
|
|
|
:func:`~django.contrib.auth.views.password_reset_confirm`,
|
|
|
|
and :func:`~django.contrib.auth.views.password_change`, you can now pass
|
|
|
|
and :func:`~django.contrib.auth.views.password_change`, you can now pass
|
|
|
|
URL names and they will be resolved.
|
|
|
|
URL names and they will be resolved.
|
|
|
|
|
|
|
|
|
|
|
|
* The ``dumpdata`` manage.py command now has a --pks option which will
|
|
|
|
* The :djadmin:`dumpdata` ``manage.py`` command now has a :djadminopt:`--pks`
|
|
|
|
allow users to specify the primary keys of objects they want to dump.
|
|
|
|
option which will allow users to specify the primary keys of objects they
|
|
|
|
This option can only be used with one model.
|
|
|
|
want to dump. This option can only be used with one model.
|
|
|
|
|
|
|
|
|
|
|
|
* Added ``QuerySet`` methods :meth:`~django.db.models.query.QuerySet.first`
|
|
|
|
* Added ``QuerySet`` methods :meth:`~django.db.models.query.QuerySet.first`
|
|
|
|
and :meth:`~django.db.models.query.QuerySet.last` which are convenience
|
|
|
|
and :meth:`~django.db.models.query.QuerySet.last` which are convenience
|
|
|
@ -259,16 +263,18 @@ Minor features
|
|
|
|
``None`` if there are no objects matching.
|
|
|
|
``None`` if there are no objects matching.
|
|
|
|
|
|
|
|
|
|
|
|
* :class:`~django.views.generic.base.View` and
|
|
|
|
* :class:`~django.views.generic.base.View` and
|
|
|
|
:class:`~django.views.generic.base.RedirectView` now support HTTP PATCH method.
|
|
|
|
:class:`~django.views.generic.base.RedirectView` now support HTTP ``PATCH``
|
|
|
|
|
|
|
|
method.
|
|
|
|
|
|
|
|
|
|
|
|
* :class:`GenericForeignKey <django.contrib.contenttypes.generic.GenericForeignKey>`
|
|
|
|
* :class:`GenericForeignKey <django.contrib.contenttypes.generic.GenericForeignKey>`
|
|
|
|
now takes an optional ``for_concrete_model`` argument, which when set to
|
|
|
|
now takes an optional
|
|
|
|
``False`` allows the field to reference proxy models. The default is ``True``
|
|
|
|
:attr:`~django.contrib.contenttypes.generic.GenericForeignKey.for_concrete_model`
|
|
|
|
to retain the old behavior.
|
|
|
|
argument, which when set to ``False`` allows the field to reference proxy
|
|
|
|
|
|
|
|
models. The default is ``True`` to retain the old behavior.
|
|
|
|
|
|
|
|
|
|
|
|
* The middleware :class:`~django.middleware.locale.LocaleMiddleware` now
|
|
|
|
* The :class:`~django.middleware.locale.LocaleMiddleware` now stores the active
|
|
|
|
stores active language in session if it is not present there. This
|
|
|
|
language in session if it is not present there. This prevents loss of
|
|
|
|
prevents loss of language settings after session flush, e.g. logout.
|
|
|
|
language settings after session flush, e.g. logout.
|
|
|
|
|
|
|
|
|
|
|
|
* :exc:`~django.core.exceptions.SuspiciousOperation` has been differentiated
|
|
|
|
* :exc:`~django.core.exceptions.SuspiciousOperation` has been differentiated
|
|
|
|
into a number of subclasses, and each will log to a matching named logger
|
|
|
|
into a number of subclasses, and each will log to a matching named logger
|
|
|
@ -316,7 +322,7 @@ Behavior changes
|
|
|
|
|
|
|
|
|
|
|
|
Database-level autocommit is enabled by default in Django 1.6. While this
|
|
|
|
Database-level autocommit is enabled by default in Django 1.6. While this
|
|
|
|
doesn't change the general spirit of Django's transaction management, there
|
|
|
|
doesn't change the general spirit of Django's transaction management, there
|
|
|
|
are a few known backwards-incompatibities, described in the :ref:`transaction
|
|
|
|
are a few known backwards-incompatibilities, described in the :ref:`transaction
|
|
|
|
management docs <transactions-upgrading-from-1.5>`. You should review your
|
|
|
|
management docs <transactions-upgrading-from-1.5>`. You should review your
|
|
|
|
code to determine if you're affected.
|
|
|
|
code to determine if you're affected.
|
|
|
|
|
|
|
|
|
|
|
@ -496,7 +502,7 @@ For Oracle, execute this query:
|
|
|
|
|
|
|
|
|
|
|
|
ALTER TABLE DJANGO_COMMENTS MODIFY (ip_address VARCHAR2(39));
|
|
|
|
ALTER TABLE DJANGO_COMMENTS MODIFY (ip_address VARCHAR2(39));
|
|
|
|
|
|
|
|
|
|
|
|
If you do not apply this change, the behaviour is unchanged: on MySQL, IPv6
|
|
|
|
If you do not apply this change, the behavior is unchanged: on MySQL, IPv6
|
|
|
|
addresses are silently truncated; on Oracle, an exception is generated. No
|
|
|
|
addresses are silently truncated; on Oracle, an exception is generated. No
|
|
|
|
database change is needed for SQLite or PostgreSQL databases.
|
|
|
|
database change is needed for SQLite or PostgreSQL databases.
|
|
|
|
|
|
|
|
|
|
|
@ -617,11 +623,12 @@ Miscellaneous
|
|
|
|
stored as ``null``. Previously, storing a ``blank`` value in a field which
|
|
|
|
stored as ``null``. Previously, storing a ``blank`` value in a field which
|
|
|
|
did not allow ``null`` would cause a database exception at runtime.
|
|
|
|
did not allow ``null`` would cause a database exception at runtime.
|
|
|
|
|
|
|
|
|
|
|
|
* If a :class:`~django.core.urlresolvers.NoReverseMatch` exception is risen
|
|
|
|
* If a :class:`~django.core.urlresolvers.NoReverseMatch` exception is raised
|
|
|
|
from a method when rendering a template it is not silenced. For example
|
|
|
|
from a method when rendering a template, it is not silenced. For example,
|
|
|
|
{{ obj.view_href }} will cause template rendering to fail if view_href()
|
|
|
|
``{{ obj.view_href }}`` will cause template rendering to fail if
|
|
|
|
raises NoReverseMatch. There is no change to {% url %} tag, it causes
|
|
|
|
``view_href()`` raises ``NoReverseMatch``. There is no change to the
|
|
|
|
template rendering to fail like always when NoReverseMatch is risen.
|
|
|
|
``{% url %}`` tag, it causes template rendering to fail like always when
|
|
|
|
|
|
|
|
``NoReverseMatch`` is risen.
|
|
|
|
|
|
|
|
|
|
|
|
* :meth:`django.test.client.Client.logout` now calls
|
|
|
|
* :meth:`django.test.client.Client.logout` now calls
|
|
|
|
:meth:`django.contrib.auth.logout` which will send the
|
|
|
|
:meth:`django.contrib.auth.logout` which will send the
|
|
|
@ -738,7 +745,7 @@ from your settings.
|
|
|
|
If you defined your own form widgets and defined the ``_has_changed`` method
|
|
|
|
If you defined your own form widgets and defined the ``_has_changed`` method
|
|
|
|
on a widget, you should now define this method on the form field itself.
|
|
|
|
on a widget, you should now define this method on the form field itself.
|
|
|
|
|
|
|
|
|
|
|
|
``module_name`` model meta attribute
|
|
|
|
``module_name`` model _meta attribute
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
``Model._meta.module_name`` was renamed to ``model_name``. Despite being a
|
|
|
|
``Model._meta.module_name`` was renamed to ``model_name``. Despite being a
|
|
|
@ -780,7 +787,7 @@ particular with boolean fields, it is possible for this problem to be completely
|
|
|
|
invisible. This is a form of `Mass assignment vulnerability
|
|
|
|
invisible. This is a form of `Mass assignment vulnerability
|
|
|
|
<http://en.wikipedia.org/wiki/Mass_assignment_vulnerability>`_.
|
|
|
|
<http://en.wikipedia.org/wiki/Mass_assignment_vulnerability>`_.
|
|
|
|
|
|
|
|
|
|
|
|
For this reason, this behaviour is deprecated, and using the ``Meta.exclude``
|
|
|
|
For this reason, this behavior is deprecated, and using the ``Meta.exclude``
|
|
|
|
option is strongly discouraged. Instead, all fields that are intended for
|
|
|
|
option is strongly discouraged. Instead, all fields that are intended for
|
|
|
|
inclusion in the form should be listed explicitly in the ``fields`` attribute.
|
|
|
|
inclusion in the form should be listed explicitly in the ``fields`` attribute.
|
|
|
|
|
|
|
|
|
|
|
@ -799,7 +806,7 @@ is another option. The admin has its own methods for defining fields
|
|
|
|
redundant. Instead, simply omit the ``Meta`` inner class of the ``ModelForm``,
|
|
|
|
redundant. Instead, simply omit the ``Meta`` inner class of the ``ModelForm``,
|
|
|
|
or omit the ``Meta.model`` attribute. Since the ``ModelAdmin`` subclass knows
|
|
|
|
or omit the ``Meta.model`` attribute. Since the ``ModelAdmin`` subclass knows
|
|
|
|
which model it is for, it can add the necessary attributes to derive a
|
|
|
|
which model it is for, it can add the necessary attributes to derive a
|
|
|
|
functioning ``ModelForm``. This behaviour also works for earlier Django
|
|
|
|
functioning ``ModelForm``. This behavior also works for earlier Django
|
|
|
|
versions.
|
|
|
|
versions.
|
|
|
|
|
|
|
|
|
|
|
|
``UpdateView`` and ``CreateView`` without explicit fields
|
|
|
|
``UpdateView`` and ``CreateView`` without explicit fields
|
|
|
@ -821,10 +828,10 @@ deprecated.
|
|
|
|
|
|
|
|
|
|
|
|
.. _m2m-help_text-deprecation:
|
|
|
|
.. _m2m-help_text-deprecation:
|
|
|
|
|
|
|
|
|
|
|
|
Munging of help text of model form fields for ManyToManyField fields
|
|
|
|
Munging of help text of model form fields for ``ManyToManyField`` fields
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
|
|
|
|
All special handling of the ``help_text`` attibute of ManyToManyField model
|
|
|
|
All special handling of the ``help_text`` attribute of ``ManyToManyField`` model
|
|
|
|
fields performed by standard model or model form fields as described in
|
|
|
|
fields performed by standard model or model form fields as described in
|
|
|
|
:ref:`m2m-help_text` above is deprecated and will be removed in Django 1.8.
|
|
|
|
:ref:`m2m-help_text` above is deprecated and will be removed in Django 1.8.
|
|
|
|
|
|
|
|
|
|
|
|