|
@@ -79,9 +79,9 @@ location of tests. The previous runner
|
|
|
:setting:`INSTALLED_APPS`.
|
|
|
|
|
|
The new runner (``django.test.runner.DiscoverRunner``) uses the test discovery
|
|
|
-features built into unittest2 (the version of unittest in the Python 2.7+
|
|
|
-standard library, and bundled with Django). With test discovery, tests can be
|
|
|
-located in any module whose name matches the pattern ``test*.py``.
|
|
|
+features built into ``unittest2`` (the version of ``unittest`` in the
|
|
|
+Python 2.7+ standard library, and bundled with Django). With test discovery,
|
|
|
+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
|
|
|
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
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
-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.
|
|
|
|
|
|
GeoDjango form widgets
|
|
@@ -127,13 +127,13 @@ Minor features
|
|
|
* Authentication backends can raise ``PermissionDenied`` to immediately fail
|
|
|
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`.
|
|
|
|
|
|
-* The ``assertQuerysetEqual()`` now checks for undefined order and raises
|
|
|
- ``ValueError`` if undefined order is spotted. The order is seen as
|
|
|
- undefined if the given ``QuerySet`` isn't ordered and there are more than
|
|
|
- one ordered values to compare against.
|
|
|
+* The :meth:`~django.test.TransactionTestCase.assertQuerysetEqual` now checks
|
|
|
+ for undefined order and raises :exc:`~exceptions.ValueError` if undefined
|
|
|
+ order is spotted. The order is seen as undefined if the given ``QuerySet``
|
|
|
+ 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
|
|
|
:meth:`~django.db.models.query.QuerySet.latest`.
|
|
@@ -146,10 +146,10 @@ Minor features
|
|
|
* The default widgets for :class:`~django.forms.EmailField`,
|
|
|
:class:`~django.forms.URLField`, :class:`~django.forms.IntegerField`,
|
|
|
:class:`~django.forms.FloatField` and :class:`~django.forms.DecimalField` use
|
|
|
- the new type attributes available in HTML5 (type='email', type='url',
|
|
|
- type='number'). Note that due to erratic support of the ``number`` input type
|
|
|
- with localized numbers in current browsers, Django only uses it when numeric
|
|
|
- fields are not localized.
|
|
|
+ the new type attributes available in HTML5 (``type='email'``, ``type='url'``,
|
|
|
+ ``type='number'``). Note that due to erratic support of the ``number``
|
|
|
+ input type with localized numbers in current browsers, Django only uses it
|
|
|
+ when numeric fields are not localized.
|
|
|
|
|
|
* The ``number`` argument for :ref:`lazy plural translations
|
|
|
<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.
|
|
|
|
|
|
* Syndication feeds (:mod:`django.contrib.syndication`) can now pass extra
|
|
|
- context through to feed templates using a new `Feed.get_context_data()`
|
|
|
- callback.
|
|
|
+ context through to feed templates using a new
|
|
|
+ :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
|
|
|
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
|
|
|
:setting:`TEMPLATE_STRING_IF_INVALID` for variables not present in the
|
|
|
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.
|
|
|
|
|
|
* Generic :class:`~django.contrib.gis.db.models.GeometryField` is now editable
|
|
@@ -210,7 +212,7 @@ Minor features
|
|
|
* The documentation contains a :doc:`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
|
|
|
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
|
|
|
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_confirm`,
|
|
|
and :func:`~django.contrib.auth.views.password_change`, you can now pass
|
|
|
URL names and they will be resolved.
|
|
|
|
|
|
-* The ``dumpdata`` manage.py command now has a --pks option which will
|
|
|
- allow users to specify the primary keys of objects they want to dump.
|
|
|
- This option can only be used with one model.
|
|
|
+* The :djadmin:`dumpdata` ``manage.py`` command now has a :djadminopt:`--pks`
|
|
|
+ option which will allow users to specify the primary keys of objects they
|
|
|
+ want to dump. This option can only be used with one model.
|
|
|
|
|
|
* Added ``QuerySet`` methods :meth:`~django.db.models.query.QuerySet.first`
|
|
|
and :meth:`~django.db.models.query.QuerySet.last` which are convenience
|
|
@@ -259,16 +263,18 @@ Minor features
|
|
|
``None`` if there are no objects matching.
|
|
|
|
|
|
* :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>`
|
|
|
- now takes an optional ``for_concrete_model`` argument, which when set to
|
|
|
- ``False`` allows the field to reference proxy models. The default is ``True``
|
|
|
- to retain the old behavior.
|
|
|
+ now takes an optional
|
|
|
+ :attr:`~django.contrib.contenttypes.generic.GenericForeignKey.for_concrete_model`
|
|
|
+ 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
|
|
|
- stores active language in session if it is not present there. This
|
|
|
- prevents loss of language settings after session flush, e.g. logout.
|
|
|
+* The :class:`~django.middleware.locale.LocaleMiddleware` now stores the active
|
|
|
+ language in session if it is not present there. This prevents loss of
|
|
|
+ language settings after session flush, e.g. logout.
|
|
|
|
|
|
* :exc:`~django.core.exceptions.SuspiciousOperation` has been differentiated
|
|
|
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
|
|
|
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
|
|
|
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));
|
|
|
|
|
|
-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
|
|
|
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
|
|
|
did not allow ``null`` would cause a database exception at runtime.
|
|
|
|
|
|
-* If a :class:`~django.core.urlresolvers.NoReverseMatch` exception is risen
|
|
|
- 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()
|
|
|
- raises NoReverseMatch. There is no change to {% url %} tag, it causes
|
|
|
- template rendering to fail like always when NoReverseMatch 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,
|
|
|
+ ``{{ obj.view_href }}`` will cause template rendering to fail if
|
|
|
+ ``view_href()`` raises ``NoReverseMatch``. There is no change to the
|
|
|
+ ``{% url %}`` tag, it causes template rendering to fail like always when
|
|
|
+ ``NoReverseMatch`` is risen.
|
|
|
|
|
|
* :meth:`django.test.client.Client.logout` now calls
|
|
|
: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
|
|
|
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
|
|
@@ -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
|
|
|
<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
|
|
|
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``,
|
|
|
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
|
|
|
-functioning ``ModelForm``. This behaviour also works for earlier Django
|
|
|
+functioning ``ModelForm``. This behavior also works for earlier Django
|
|
|
versions.
|
|
|
|
|
|
``UpdateView`` and ``CreateView`` without explicit fields
|
|
@@ -821,10 +828,10 @@ deprecated.
|
|
|
|
|
|
.. _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
|
|
|
:ref:`m2m-help_text` above is deprecated and will be removed in Django 1.8.
|
|
|
|