Removed versionadded/changed annotations for 2.2.
This commit is contained in:
parent
32796826bb
commit
416c584cab
|
@ -257,10 +257,6 @@ the :meth:`~BaseCommand.handle` method must be implemented.
|
||||||
You can customize the instance by overriding this method and calling
|
You can customize the instance by overriding this method and calling
|
||||||
``super()`` with ``kwargs`` of :class:`~argparse.ArgumentParser` parameters.
|
``super()`` with ``kwargs`` of :class:`~argparse.ArgumentParser` parameters.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
``kwargs`` was added.
|
|
||||||
|
|
||||||
.. method:: BaseCommand.add_arguments(parser)
|
.. method:: BaseCommand.add_arguments(parser)
|
||||||
|
|
||||||
Entry point to add parser arguments to handle command line arguments passed
|
Entry point to add parser arguments to handle command line arguments passed
|
||||||
|
|
|
@ -79,8 +79,6 @@ MRO is an acronym for Method Resolution Order.
|
||||||
|
|
||||||
.. method:: setup(request, *args, **kwargs)
|
.. method:: setup(request, *args, **kwargs)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Initializes view instance attributes: ``self.request``, ``self.args``,
|
Initializes view instance attributes: ``self.request``, ``self.args``,
|
||||||
and ``self.kwargs`` prior to :meth:`dispatch`.
|
and ``self.kwargs`` prior to :meth:`dispatch`.
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,6 @@ system along with all the fields, properties, and methods available on it.
|
||||||
Relationships to other models appear as hyperlinks. Descriptions are pulled
|
Relationships to other models appear as hyperlinks. Descriptions are pulled
|
||||||
from ``help_text`` attributes on fields or from docstrings on model methods.
|
from ``help_text`` attributes on fields or from docstrings on model methods.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Older versions don't display model properties.
|
|
||||||
|
|
||||||
A model with useful documentation might look like this::
|
A model with useful documentation might look like this::
|
||||||
|
|
||||||
class BlogEntry(models.Model):
|
class BlogEntry(models.Model):
|
||||||
|
|
|
@ -396,10 +396,6 @@ Fields
|
||||||
Required. 150 characters or fewer. Any characters are permitted.
|
Required. 150 characters or fewer. Any characters are permitted.
|
||||||
Example: ``'Awesome Users'``.
|
Example: ``'Awesome Users'``.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``max_length`` increased from 80 to 150 characters.
|
|
||||||
|
|
||||||
.. attribute:: permissions
|
.. attribute:: permissions
|
||||||
|
|
||||||
Many-to-many field to :class:`~django.contrib.auth.models.Permission`::
|
Many-to-many field to :class:`~django.contrib.auth.models.Permission`::
|
||||||
|
@ -677,11 +673,6 @@ The following backends are available in :mod:`django.contrib.auth.backends`:
|
||||||
if it wasn't provided to :func:`~django.contrib.auth.authenticate`
|
if it wasn't provided to :func:`~django.contrib.auth.authenticate`
|
||||||
(which passes it on to the backend).
|
(which passes it on to the backend).
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``request`` argument was added. Support for method overrides
|
|
||||||
that don't accept it will be removed in Django 3.1.
|
|
||||||
|
|
||||||
.. method:: user_can_authenticate()
|
.. method:: user_can_authenticate()
|
||||||
|
|
||||||
Returns whether the user is allowed to authenticate. This method
|
Returns whether the user is allowed to authenticate. This method
|
||||||
|
|
|
@ -274,10 +274,6 @@ SDO_GEOM-reference.html#GUID-646638D0-2C5F-490A-AF63-DE9B7A4C97C1__CHDJCEIH>`__,
|
||||||
Accepts a single geographic field or expression and returns the geometry
|
Accepts a single geographic field or expression and returns the geometry
|
||||||
representing the bounding box of the geometry.
|
representing the bounding box of the geometry.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Oracle support was added.
|
|
||||||
|
|
||||||
``ForcePolygonCW``
|
``ForcePolygonCW``
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
|
|
@ -193,10 +193,6 @@ Example::
|
||||||
|
|
||||||
Zipcode.objects.filter(poly__coveredby=geom)
|
Zipcode.objects.filter(poly__coveredby=geom)
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
SpatiaLite support was added.
|
|
||||||
|
|
||||||
========== =============================
|
========== =============================
|
||||||
Backend SQL Equivalent
|
Backend SQL Equivalent
|
||||||
========== =============================
|
========== =============================
|
||||||
|
@ -220,10 +216,6 @@ Example::
|
||||||
|
|
||||||
Zipcode.objects.filter(poly__covers=geom)
|
Zipcode.objects.filter(poly__covers=geom)
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
SpatiaLite support was added.
|
|
||||||
|
|
||||||
========== ==========================
|
========== ==========================
|
||||||
Backend SQL Equivalent
|
Backend SQL Equivalent
|
||||||
========== ==========================
|
========== ==========================
|
||||||
|
|
|
@ -39,8 +39,6 @@ General-purpose aggregation functions
|
||||||
|
|
||||||
.. attribute:: ordering
|
.. attribute:: ordering
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
An optional string of a field name (with an optional ``"-"`` prefix
|
An optional string of a field name (with an optional ``"-"`` prefix
|
||||||
which indicates descending order) or an expression (or a tuple or list
|
which indicates descending order) or an expression (or a tuple or list
|
||||||
of strings and/or expressions) that specifies the ordering of the
|
of strings and/or expressions) that specifies the ordering of the
|
||||||
|
@ -111,8 +109,6 @@ General-purpose aggregation functions
|
||||||
|
|
||||||
.. attribute:: ordering
|
.. attribute:: ordering
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
An optional string of a field name (with an optional ``"-"`` prefix
|
An optional string of a field name (with an optional ``"-"`` prefix
|
||||||
which indicates descending order) or an expression (or a tuple or list
|
which indicates descending order) or an expression (or a tuple or list
|
||||||
of strings and/or expressions) that specifies the ordering of the
|
of strings and/or expressions) that specifies the ordering of the
|
||||||
|
|
|
@ -656,8 +656,6 @@ excluded; that is, ``[)``.
|
||||||
|
|
||||||
.. class:: DecimalRangeField(**options)
|
.. class:: DecimalRangeField(**options)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Stores a range of floating point values. Based on a
|
Stores a range of floating point values. Based on a
|
||||||
:class:`~django.db.models.DecimalField`. Represented by a ``numrange`` in
|
:class:`~django.db.models.DecimalField`. Represented by a ``numrange`` in
|
||||||
the database and a :class:`~psycopg2:psycopg2.extras.NumericRange` in
|
the database and a :class:`~psycopg2:psycopg2.extras.NumericRange` in
|
||||||
|
|
|
@ -197,8 +197,6 @@ not greater than the upper bound. All of these fields use
|
||||||
|
|
||||||
.. class:: DecimalRangeField
|
.. class:: DecimalRangeField
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Based on :class:`~django.forms.DecimalField` and translates its input into
|
Based on :class:`~django.forms.DecimalField` and translates its input into
|
||||||
:class:`~psycopg2:psycopg2.extras.NumericRange`. Default for
|
:class:`~psycopg2:psycopg2.extras.NumericRange`. Default for
|
||||||
:class:`~django.contrib.postgres.fields.DecimalRangeField`.
|
:class:`~django.contrib.postgres.fields.DecimalRangeField`.
|
||||||
|
|
|
@ -22,17 +22,11 @@ available from the ``django.contrib.postgres.indexes`` module.
|
||||||
|
|
||||||
.. _automatic summarization: https://www.postgresql.org/docs/current/brin-intro.html#BRIN-OPERATION
|
.. _automatic summarization: https://www.postgresql.org/docs/current/brin-intro.html#BRIN-OPERATION
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``autosummarize`` parameter was added.
|
|
||||||
|
|
||||||
``BTreeIndex``
|
``BTreeIndex``
|
||||||
==============
|
==============
|
||||||
|
|
||||||
.. class:: BTreeIndex(fillfactor=None, **options)
|
.. class:: BTreeIndex(fillfactor=None, **options)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Creates a B-Tree index.
|
Creates a B-Tree index.
|
||||||
|
|
||||||
Provide an integer value from 10 to 100 to the fillfactor_ parameter to
|
Provide an integer value from 10 to 100 to the fillfactor_ parameter to
|
||||||
|
@ -100,8 +94,6 @@ available from the ``django.contrib.postgres.indexes`` module.
|
||||||
|
|
||||||
.. class:: HashIndex(fillfactor=None, **options)
|
.. class:: HashIndex(fillfactor=None, **options)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Creates a hash index.
|
Creates a hash index.
|
||||||
|
|
||||||
Provide an integer value from 10 to 100 to the fillfactor_ parameter to
|
Provide an integer value from 10 to 100 to the fillfactor_ parameter to
|
||||||
|
@ -119,8 +111,6 @@ available from the ``django.contrib.postgres.indexes`` module.
|
||||||
|
|
||||||
.. class:: SpGistIndex(fillfactor=None, **options)
|
.. class:: SpGistIndex(fillfactor=None, **options)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Creates an `SP-GiST index
|
Creates an `SP-GiST index
|
||||||
<https://www.postgresql.org/docs/current/spgist.html>`_.
|
<https://www.postgresql.org/docs/current/spgist.html>`_.
|
||||||
|
|
||||||
|
|
|
@ -102,10 +102,6 @@ Search docs`_ to learn about differences and syntax. Examples:
|
||||||
See :ref:`postgresql-fts-search-configuration` for an explanation of the
|
See :ref:`postgresql-fts-search-configuration` for an explanation of the
|
||||||
``config`` parameter.
|
``config`` parameter.
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The `search_type` parameter was added.
|
|
||||||
|
|
||||||
``SearchRank``
|
``SearchRank``
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
|
|
@ -499,11 +499,6 @@ that: :func:`django.contrib.sitemaps.ping_google()`.
|
||||||
``django.contrib.sitemaps.SitemapNotFound`` if it cannot determine your
|
``django.contrib.sitemaps.SitemapNotFound`` if it cannot determine your
|
||||||
sitemap URL.
|
sitemap URL.
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The ``sitemap_uses_https`` argument was added. Older versions of
|
|
||||||
Django always use ``http`` for a sitemap's URL.
|
|
||||||
|
|
||||||
.. admonition:: Register with Google first!
|
.. admonition:: Register with Google first!
|
||||||
|
|
||||||
The :func:`ping_google` command only works if you have registered your
|
The :func:`ping_google` command only works if you have registered your
|
||||||
|
@ -544,6 +539,4 @@ ping Google using the ``ping_google`` management command::
|
||||||
|
|
||||||
.. django-admin-option:: --sitemap-uses-http
|
.. django-admin-option:: --sitemap-uses-http
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Use this option if your sitemap uses ``http`` rather than ``https``.
|
Use this option if your sitemap uses ``http`` rather than ``https``.
|
||||||
|
|
|
@ -96,10 +96,6 @@ Some commonly used options are:
|
||||||
multiple times to ignore more. When specifying a path, always use forward
|
multiple times to ignore more. When specifying a path, always use forward
|
||||||
slashes, even on Windows.
|
slashes, even on Windows.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Path matching was added.
|
|
||||||
|
|
||||||
.. django-admin-option:: --dry-run, -n
|
.. django-admin-option:: --dry-run, -n
|
||||||
|
|
||||||
Do everything except modify the filesystem.
|
Do everything except modify the filesystem.
|
||||||
|
|
|
@ -421,18 +421,12 @@ PostgreSQL
|
||||||
* Models are created for partition tables if
|
* Models are created for partition tables if
|
||||||
:option:`--include-partitions` is used.
|
:option:`--include-partitions` is used.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Support for foreign tables and materialized views was added.
|
|
||||||
|
|
||||||
.. django-admin-option:: --database DATABASE
|
.. django-admin-option:: --database DATABASE
|
||||||
|
|
||||||
Specifies the database to introspect. Defaults to ``default``.
|
Specifies the database to introspect. Defaults to ``default``.
|
||||||
|
|
||||||
.. django-admin-option:: --include-partitions
|
.. django-admin-option:: --include-partitions
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
If this option is provided, models are also created for partitions.
|
If this option is provided, models are also created for partitions.
|
||||||
|
|
||||||
Only support for PostgreSQL is implemented.
|
Only support for PostgreSQL is implemented.
|
||||||
|
@ -783,8 +777,6 @@ name must be a valid Python :ref:`identifier <python:identifiers>`.
|
||||||
|
|
||||||
.. django-admin-option:: --no-header
|
.. django-admin-option:: --no-header
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Generate migration files without Django version and timestamp header.
|
Generate migration files without Django version and timestamp header.
|
||||||
|
|
||||||
.. django-admin-option:: --check
|
.. django-admin-option:: --check
|
||||||
|
@ -841,8 +833,6 @@ schema matches what is recorded in your initial migration.
|
||||||
|
|
||||||
.. django-admin-option:: --plan
|
.. django-admin-option:: --plan
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Shows the migration operations that will be performed for the given ``migrate``
|
Shows the migration operations that will be performed for the given ``migrate``
|
||||||
command.
|
command.
|
||||||
|
|
||||||
|
@ -907,10 +897,6 @@ more robust change detection, and a reduction in power usage. Django supports
|
||||||
.. _pywatchman: https://pypi.org/project/pywatchman/
|
.. _pywatchman: https://pypi.org/project/pywatchman/
|
||||||
.. _watchman documentation: https://facebook.github.io/watchman/docs/config.html#ignore_dirs
|
.. _watchman documentation: https://facebook.github.io/watchman/docs/config.html#ignore_dirs
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Watchman support replaced support for `pyinotify`.
|
|
||||||
|
|
||||||
When you start the server, and each time you change Python code while the
|
When you start the server, and each time you change Python code while the
|
||||||
server is running, the system check framework will check your entire Django
|
server is running, the system check framework will check your entire Django
|
||||||
project for some common errors (see the :djadmin:`check` command). If any
|
project for some common errors (see the :djadmin:`check` command). If any
|
||||||
|
@ -1193,8 +1179,6 @@ first and last migration, with ``_squashed_`` in between.
|
||||||
|
|
||||||
.. django-admin-option:: --no-header
|
.. django-admin-option:: --no-header
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Generate squashed migration file without Django version and timestamp header.
|
Generate squashed migration file without Django version and timestamp header.
|
||||||
|
|
||||||
``startapp``
|
``startapp``
|
||||||
|
@ -1762,8 +1746,6 @@ Example usage::
|
||||||
|
|
||||||
.. django-admin-option:: --force-color
|
.. django-admin-option:: --force-color
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Forces colorization of the command output if it would otherwise be disabled
|
Forces colorization of the command output if it would otherwise be disabled
|
||||||
as discussed in :ref:`syntax-coloring`. For example, you may want to pipe
|
as discussed in :ref:`syntax-coloring`. For example, you may want to pipe
|
||||||
colored output to another command.
|
colored output to another command.
|
||||||
|
|
|
@ -212,8 +212,6 @@ Removes the index named ``name`` from the model with ``model_name``.
|
||||||
|
|
||||||
.. class:: AddConstraint(model_name, constraint)
|
.. class:: AddConstraint(model_name, constraint)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Creates a :doc:`constraint </ref/models/constraints>` in the database table for
|
Creates a :doc:`constraint </ref/models/constraints>` in the database table for
|
||||||
the model with ``model_name``.
|
the model with ``model_name``.
|
||||||
|
|
||||||
|
@ -222,8 +220,6 @@ the model with ``model_name``.
|
||||||
|
|
||||||
.. class:: RemoveConstraint(model_name, name)
|
.. class:: RemoveConstraint(model_name, name)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Removes the constraint named ``name`` from the model with ``model_name``.
|
Removes the constraint named ``name`` from the model with ``model_name``.
|
||||||
|
|
||||||
Special Operations
|
Special Operations
|
||||||
|
|
|
@ -6,8 +6,6 @@ Constraints reference
|
||||||
|
|
||||||
.. currentmodule:: django.db.models
|
.. currentmodule:: django.db.models
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The classes defined in this module create database constraints. They are added
|
The classes defined in this module create database constraints. They are added
|
||||||
in the model :attr:`Meta.constraints <django.db.models.Options.constraints>`
|
in the model :attr:`Meta.constraints <django.db.models.Options.constraints>`
|
||||||
option.
|
option.
|
||||||
|
|
|
@ -154,8 +154,6 @@ will result in a database error.
|
||||||
|
|
||||||
.. class:: NullIf(expression1, expression2)
|
.. class:: NullIf(expression1, expression2)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Accepts two expressions and returns ``None`` if they are equal, otherwise
|
Accepts two expressions and returns ``None`` if they are equal, otherwise
|
||||||
returns ``expression1``.
|
returns ``expression1``.
|
||||||
|
|
||||||
|
@ -274,8 +272,6 @@ Usage example::
|
||||||
|
|
||||||
.. class:: ExtractIsoYear(expression, tzinfo=None, **extra)
|
.. class:: ExtractIsoYear(expression, tzinfo=None, **extra)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Returns the ISO-8601 week-numbering year.
|
Returns the ISO-8601 week-numbering year.
|
||||||
|
|
||||||
.. attribute:: lookup_name = 'iso_year'
|
.. attribute:: lookup_name = 'iso_year'
|
||||||
|
@ -716,8 +712,6 @@ that deal with time-parts can be used with ``TimeField``::
|
||||||
Math Functions
|
Math Functions
|
||||||
==============
|
==============
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
We'll be using the following model in math function examples::
|
We'll be using the following model in math function examples::
|
||||||
|
|
||||||
class Vector(models.Model):
|
class Vector(models.Model):
|
||||||
|
@ -1419,8 +1413,6 @@ Usage example::
|
||||||
|
|
||||||
.. class:: Reverse(expression, **extra)
|
.. class:: Reverse(expression, **extra)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Accepts a single text field or expression and returns the characters of that
|
Accepts a single text field or expression and returns the characters of that
|
||||||
expression in reverse order.
|
expression in reverse order.
|
||||||
|
|
||||||
|
|
|
@ -400,8 +400,6 @@ The ``Aggregate`` API is as follows:
|
||||||
|
|
||||||
.. attribute:: allow_distinct
|
.. attribute:: allow_distinct
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
A class attribute determining whether or not this aggregate function
|
A class attribute determining whether or not this aggregate function
|
||||||
allows passing a ``distinct`` keyword argument. If set to ``False``
|
allows passing a ``distinct`` keyword argument. If set to ``False``
|
||||||
(default), ``TypeError`` is raised if ``distinct=True`` is passed.
|
(default), ``TypeError`` is raised if ``distinct=True`` is passed.
|
||||||
|
@ -435,10 +433,6 @@ and :ref:`filtering-on-annotations` for example usage.
|
||||||
The ``**extra`` kwargs are ``key=value`` pairs that can be interpolated
|
The ``**extra`` kwargs are ``key=value`` pairs that can be interpolated
|
||||||
into the ``template`` attribute.
|
into the ``template`` attribute.
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The ``allow_distinct`` attribute and ``distinct`` argument were added.
|
|
||||||
|
|
||||||
Creating your own Aggregate Functions
|
Creating your own Aggregate Functions
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -90,8 +90,6 @@ in the same tablespace as the table.
|
||||||
|
|
||||||
.. attribute:: Index.opclasses
|
.. attribute:: Index.opclasses
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The names of the `PostgreSQL operator classes
|
The names of the `PostgreSQL operator classes
|
||||||
<https://www.postgresql.org/docs/current/indexes-opclass.html>`_ to use for
|
<https://www.postgresql.org/docs/current/indexes-opclass.html>`_ to use for
|
||||||
this index. If you require a custom operator class, you must provide one for
|
this index. If you require a custom operator class, you must provide one for
|
||||||
|
@ -110,8 +108,6 @@ opclasses=['jsonb_path_ops'])`` creates a gin index on ``jsonfield`` using
|
||||||
|
|
||||||
.. attribute:: Index.condition
|
.. attribute:: Index.condition
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
If the table is very large and your queries mostly target a subset of rows,
|
If the table is very large and your queries mostly target a subset of rows,
|
||||||
it may be useful to restrict an index to that subset. Specify a condition as a
|
it may be useful to restrict an index to that subset. Specify a condition as a
|
||||||
:class:`~django.db.models.Q`. For example, ``condition=Q(pages__gt=400)``
|
:class:`~django.db.models.Q`. For example, ``condition=Q(pages__gt=400)``
|
||||||
|
|
|
@ -459,8 +459,6 @@ Django quotes column and table names behind the scenes.
|
||||||
|
|
||||||
.. attribute:: Options.constraints
|
.. attribute:: Options.constraints
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
A list of :doc:`constraints </ref/models/constraints>` that you want to
|
A list of :doc:`constraints </ref/models/constraints>` that you want to
|
||||||
define on the model::
|
define on the model::
|
||||||
|
|
||||||
|
|
|
@ -2091,15 +2091,9 @@ that fail constraints such as duplicate unique values. Enabling this parameter
|
||||||
disables setting the primary key on each model instance (if the database
|
disables setting the primary key on each model instance (if the database
|
||||||
normally supports it).
|
normally supports it).
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``ignore_conflicts`` parameter was added.
|
|
||||||
|
|
||||||
``bulk_update()``
|
``bulk_update()``
|
||||||
~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
.. method:: bulk_update(objs, fields, batch_size=None)
|
.. method:: bulk_update(objs, fields, batch_size=None)
|
||||||
|
|
||||||
This method efficiently updates the given fields on the provided model
|
This method efficiently updates the given fields on the provided model
|
||||||
|
@ -2253,10 +2247,6 @@ psycopg mailing list <https://www.postgresql.org/message-id/4D2F2C71.8080805%40d
|
||||||
between the number of rows transferred and the data discarded if the loop
|
between the number of rows transferred and the data discarded if the loop
|
||||||
is exited early.
|
is exited early.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Support for result streaming on SQLite was added.
|
|
||||||
|
|
||||||
``latest()``
|
``latest()``
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -3003,8 +2993,6 @@ in the database <database-time-zone-definitions>`.
|
||||||
``iso_year``
|
``iso_year``
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
For date and datetime fields, an exact ISO 8601 week-numbering year match.
|
For date and datetime fields, an exact ISO 8601 week-numbering year match.
|
||||||
Allows chaining additional field lookups. Takes an integer year.
|
Allows chaining additional field lookups. Takes an integer year.
|
||||||
|
|
||||||
|
@ -3464,10 +3452,6 @@ by the aggregate.
|
||||||
By default, ``StdDev`` returns the population standard deviation. However,
|
By default, ``StdDev`` returns the population standard deviation. However,
|
||||||
if ``sample=True``, the return value will be the sample standard deviation.
|
if ``sample=True``, the return value will be the sample standard deviation.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
SQLite support was added.
|
|
||||||
|
|
||||||
``Sum``
|
``Sum``
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
|
@ -3508,10 +3492,6 @@ by the aggregate.
|
||||||
By default, ``Variance`` returns the population variance. However,
|
By default, ``Variance`` returns the population variance. However,
|
||||||
if ``sample=True``, the return value will be the sample variance.
|
if ``sample=True``, the return value will be the sample variance.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
SQLite support was added.
|
|
||||||
|
|
||||||
Query-related tools
|
Query-related tools
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
|
|
@ -73,10 +73,6 @@ Related objects reference
|
||||||
:ref:`intermediate model <intermediary-manytomany>` instance(s), if
|
:ref:`intermediate model <intermediary-manytomany>` instance(s), if
|
||||||
needed.
|
needed.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``through_defaults`` argument was added.
|
|
||||||
|
|
||||||
.. method:: create(through_defaults=None, **kwargs)
|
.. method:: create(through_defaults=None, **kwargs)
|
||||||
|
|
||||||
Creates a new object, saves it and puts it in the related object set.
|
Creates a new object, saves it and puts it in the related object set.
|
||||||
|
@ -111,10 +107,6 @@ Related objects reference
|
||||||
:ref:`intermediate model <intermediary-manytomany>` instance, if
|
:ref:`intermediate model <intermediary-manytomany>` instance, if
|
||||||
needed.
|
needed.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``through_defaults`` argument was added.
|
|
||||||
|
|
||||||
.. method:: remove(*objs, bulk=True)
|
.. method:: remove(*objs, bulk=True)
|
||||||
|
|
||||||
Removes the specified model objects from the related object set::
|
Removes the specified model objects from the related object set::
|
||||||
|
@ -203,10 +195,6 @@ Related objects reference
|
||||||
:ref:`intermediate model <intermediary-manytomany>` instance(s), if
|
:ref:`intermediate model <intermediary-manytomany>` instance(s), if
|
||||||
needed.
|
needed.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The ``through_defaults`` argument was added.
|
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
Note that ``add()``, ``create()``, ``remove()``, ``clear()``, and
|
Note that ``add()``, ``create()``, ``remove()``, ``clear()``, and
|
||||||
|
|
|
@ -172,8 +172,6 @@ All attributes should be considered read-only, unless stated otherwise.
|
||||||
|
|
||||||
.. attribute:: HttpRequest.headers
|
.. attribute:: HttpRequest.headers
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
A case insensitive, dict-like object that provides access to all
|
A case insensitive, dict-like object that provides access to all
|
||||||
HTTP-prefixed headers (plus ``Content-Length`` and ``Content-Type``) from
|
HTTP-prefixed headers (plus ``Content-Length`` and ``Content-Type``) from
|
||||||
the request.
|
the request.
|
||||||
|
|
|
@ -86,8 +86,6 @@ Removes ``index`` from ``model``’s table.
|
||||||
|
|
||||||
.. method:: BaseDatabaseSchemaEditor.add_constraint(model, constraint)
|
.. method:: BaseDatabaseSchemaEditor.add_constraint(model, constraint)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Adds ``constraint`` to ``model``'s table.
|
Adds ``constraint`` to ``model``'s table.
|
||||||
|
|
||||||
``remove_constraint()``
|
``remove_constraint()``
|
||||||
|
@ -95,8 +93,6 @@ Adds ``constraint`` to ``model``'s table.
|
||||||
|
|
||||||
.. method:: BaseDatabaseSchemaEditor.remove_constraint(model, constraint)
|
.. method:: BaseDatabaseSchemaEditor.remove_constraint(model, constraint)
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Removes ``constraint`` from ``model``'s table.
|
Removes ``constraint`` from ``model``'s table.
|
||||||
|
|
||||||
``alter_unique_together()``
|
``alter_unique_together()``
|
||||||
|
|
|
@ -846,8 +846,6 @@ when running tests. If not provided, Django will generate a random password.
|
||||||
``ORACLE_MANAGED_FILES``
|
``ORACLE_MANAGED_FILES``
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Default: ``False``
|
Default: ``False``
|
||||||
|
|
||||||
This is an Oracle-specific setting.
|
This is an Oracle-specific setting.
|
||||||
|
|
|
@ -132,8 +132,6 @@ If the URL does not resolve, the function raises a
|
||||||
|
|
||||||
.. attribute:: ResolverMatch.route
|
.. attribute:: ResolverMatch.route
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The route of the matching URL pattern.
|
The route of the matching URL pattern.
|
||||||
|
|
||||||
For example, if ``path('users/<id>/', ...)`` is the matching pattern,
|
For example, if ``path('users/<id>/', ...)`` is the matching pattern,
|
||||||
|
|
|
@ -141,11 +141,6 @@ The functions defined in this module share the following properties:
|
||||||
UTC offsets are supported; if ``value`` describes one, the result's
|
UTC offsets are supported; if ``value`` describes one, the result's
|
||||||
``tzinfo`` attribute is a :class:`datetime.timezone` instance.
|
``tzinfo`` attribute is a :class:`datetime.timezone` instance.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
In older versions, the ``tzinfo`` attribute is a
|
|
||||||
:class:`~django.utils.timezone.FixedOffset` instance.
|
|
||||||
|
|
||||||
.. function:: parse_duration(value)
|
.. function:: parse_duration(value)
|
||||||
|
|
||||||
Parses a string and returns a :class:`datetime.timedelta`.
|
Parses a string and returns a :class:`datetime.timedelta`.
|
||||||
|
@ -503,11 +498,6 @@ https://web.archive.org/web/20110718035220/http://diveintomark.org/archives/2004
|
||||||
|
|
||||||
You only need the ``name`` argument for Python < 3.6 support.
|
You only need the ``name`` argument for Python < 3.6 support.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Older versions of Django require the ``name`` argument for all versions
|
|
||||||
of Python.
|
|
||||||
|
|
||||||
While ``person.get_friends()`` will recompute the friends on each call, the
|
While ``person.get_friends()`` will recompute the friends on each call, the
|
||||||
value of the cached property will persist until you delete it as described
|
value of the cached property will persist until you delete it as described
|
||||||
above::
|
above::
|
||||||
|
@ -721,19 +711,11 @@ escaping HTML.
|
||||||
Encodes a bytestring to a base64 string for use in URLs, stripping any
|
Encodes a bytestring to a base64 string for use in URLs, stripping any
|
||||||
trailing equal signs.
|
trailing equal signs.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
In older versions, it returns a bytestring instead of a string.
|
|
||||||
|
|
||||||
.. function:: urlsafe_base64_decode(s)
|
.. function:: urlsafe_base64_decode(s)
|
||||||
|
|
||||||
Decodes a base64 encoded string, adding back any trailing equal signs that
|
Decodes a base64 encoded string, adding back any trailing equal signs that
|
||||||
might have been stripped.
|
might have been stripped.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
In older versions, ``s`` may be a bytestring.
|
|
||||||
|
|
||||||
``django.utils.module_loading``
|
``django.utils.module_loading``
|
||||||
===============================
|
===============================
|
||||||
|
|
||||||
|
|
|
@ -239,10 +239,6 @@ to, or in lieu of custom ``field.clean()`` methods.
|
||||||
``'max_value'`` if ``value`` is greater than ``limit_value``, which may be
|
``'max_value'`` if ``value`` is greater than ``limit_value``, which may be
|
||||||
a callable.
|
a callable.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
``limit_value`` can now be a callable.
|
|
||||||
|
|
||||||
``MinValueValidator``
|
``MinValueValidator``
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
@ -252,10 +248,6 @@ to, or in lieu of custom ``field.clean()`` methods.
|
||||||
``'min_value'`` if ``value`` is less than ``limit_value``, which may be a
|
``'min_value'`` if ``value`` is less than ``limit_value``, which may be a
|
||||||
callable.
|
callable.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
``limit_value`` can now be a callable.
|
|
||||||
|
|
||||||
``MaxLengthValidator``
|
``MaxLengthValidator``
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -265,10 +257,6 @@ to, or in lieu of custom ``field.clean()`` methods.
|
||||||
``'max_length'`` if the length of ``value`` is greater than
|
``'max_length'`` if the length of ``value`` is greater than
|
||||||
``limit_value``, which may be a callable.
|
``limit_value``, which may be a callable.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
``limit_value`` can now be a callable.
|
|
||||||
|
|
||||||
``MinLengthValidator``
|
``MinLengthValidator``
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
|
@ -278,10 +266,6 @@ to, or in lieu of custom ``field.clean()`` methods.
|
||||||
``'min_length'`` if the length of ``value`` is less than ``limit_value``,
|
``'min_length'`` if the length of ``value`` is less than ``limit_value``,
|
||||||
which may be a callable.
|
which may be a callable.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
``limit_value`` can now be a callable.
|
|
||||||
|
|
||||||
``DecimalValidator``
|
``DecimalValidator``
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
|
|
@ -271,11 +271,6 @@ attribute or to a :class:`~django.contrib.auth.models.Group` via its
|
||||||
|
|
||||||
content_type = ContentType.objects.get_for_model(BlogPostProxy, for_concrete_model=False)
|
content_type = ContentType.objects.get_for_model(BlogPostProxy, for_concrete_model=False)
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
In older versions, proxy models use the content type of the concrete
|
|
||||||
model.
|
|
||||||
|
|
||||||
Permission caching
|
Permission caching
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
@ -350,11 +345,6 @@ inherit the permissions of the concrete model they subclass::
|
||||||
>>> user.has_perms(('app.add_student', 'app.can_deliver_pizzas'))
|
>>> user.has_perms(('app.add_student', 'app.can_deliver_pizzas'))
|
||||||
True
|
True
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
In older versions, permissions for proxy models use the content type of
|
|
||||||
the concrete model rather than content type of the proxy model.
|
|
||||||
|
|
||||||
.. _auth-web-requests:
|
.. _auth-web-requests:
|
||||||
|
|
||||||
Authentication in Web requests
|
Authentication in Web requests
|
||||||
|
|
|
@ -370,8 +370,6 @@ for your use case.
|
||||||
Update in bulk
|
Update in bulk
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
When updating objects, where possible, use the
|
When updating objects, where possible, use the
|
||||||
:meth:`~django.db.models.query.QuerySet.bulk_update()` method to reduce the
|
:meth:`~django.db.models.query.QuerySet.bulk_update()` method to reduce the
|
||||||
number of SQL queries. Given a list or queryset of objects::
|
number of SQL queries. Given a list or queryset of objects::
|
||||||
|
|
|
@ -684,10 +684,6 @@ Django can serialize the following:
|
||||||
- Any class reference (must be in module's top-level scope)
|
- Any class reference (must be in module's top-level scope)
|
||||||
- Anything with a custom ``deconstruct()`` method (:ref:`see below <custom-deconstruct-method>`)
|
- Anything with a custom ``deconstruct()`` method (:ref:`see below <custom-deconstruct-method>`)
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
Serialization support for ``NoneType`` was added.
|
|
||||||
|
|
||||||
Django cannot serialize:
|
Django cannot serialize:
|
||||||
|
|
||||||
- Nested classes
|
- Nested classes
|
||||||
|
@ -699,8 +695,6 @@ Django cannot serialize:
|
||||||
Custom serializers
|
Custom serializers
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
You can serialize other types by writing a custom serializer. For example, if
|
You can serialize other types by writing a custom serializer. For example, if
|
||||||
Django didn't serialize :class:`~decimal.Decimal` by default, you could do
|
Django didn't serialize :class:`~decimal.Decimal` by default, you could do
|
||||||
this::
|
this::
|
||||||
|
|
|
@ -517,8 +517,6 @@ command line flags to generate natural keys.
|
||||||
Natural keys and forward references
|
Natural keys and forward references
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Sometimes when you use :ref:`natural foreign keys
|
Sometimes when you use :ref:`natural foreign keys
|
||||||
<topics-serialization-natural-keys>` you'll need to deserialize data where
|
<topics-serialization-natural-keys>` you'll need to deserialize data where
|
||||||
an object has a foreign key referencing another object that hasn't yet been
|
an object has a foreign key referencing another object that hasn't yet been
|
||||||
|
|
|
@ -628,10 +628,6 @@ utility methods in the ``django.test.utils`` module.
|
||||||
databases should be setup for. If it's not provided, it defaults to all of
|
databases should be setup for. If it's not provided, it defaults to all of
|
||||||
:setting:`DATABASES` aliases.
|
:setting:`DATABASES` aliases.
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
The ``aliases`` argument was added.
|
|
||||||
|
|
||||||
.. function:: teardown_databases(old_config, parallel=0, keepdb=False)
|
.. function:: teardown_databases(old_config, parallel=0, keepdb=False)
|
||||||
|
|
||||||
Destroys the test databases, restoring pre-test conditions.
|
Destroys the test databases, restoring pre-test conditions.
|
||||||
|
|
|
@ -225,11 +225,6 @@ Use the ``django.test.Client`` class to make requests.
|
||||||
:class:`Client`. This serialization also happens for :meth:`put`,
|
:class:`Client`. This serialization also happens for :meth:`put`,
|
||||||
:meth:`patch`, and :meth:`delete` requests.
|
:meth:`patch`, and :meth:`delete` requests.
|
||||||
|
|
||||||
.. versionchanged:: 2.2
|
|
||||||
|
|
||||||
The JSON serialization was extended to support lists and tuples. In
|
|
||||||
older versions, only dicts are serialized.
|
|
||||||
|
|
||||||
If you provide any other ``content_type`` (e.g. :mimetype:`text/xml`
|
If you provide any other ``content_type`` (e.g. :mimetype:`text/xml`
|
||||||
for an XML payload), the contents of ``data`` are sent as-is in the
|
for an XML payload), the contents of ``data`` are sent as-is in the
|
||||||
POST request, using ``content_type`` in the HTTP ``Content-Type``
|
POST request, using ``content_type`` in the HTTP ``Content-Type``
|
||||||
|
@ -745,8 +740,6 @@ If your tests make any database queries, use subclasses
|
||||||
|
|
||||||
.. attribute:: SimpleTestCase.databases
|
.. attribute:: SimpleTestCase.databases
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
:class:`~SimpleTestCase` disallows database queries by default. This
|
:class:`~SimpleTestCase` disallows database queries by default. This
|
||||||
helps to avoid executing write queries which will affect other tests
|
helps to avoid executing write queries which will affect other tests
|
||||||
since each ``SimpleTestCase`` test isn't run in a transaction. If you
|
since each ``SimpleTestCase`` test isn't run in a transaction. If you
|
||||||
|
@ -1152,8 +1145,6 @@ Multi-database support
|
||||||
|
|
||||||
.. attribute:: TransactionTestCase.databases
|
.. attribute:: TransactionTestCase.databases
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Django sets up a test database corresponding to every database that is
|
Django sets up a test database corresponding to every database that is
|
||||||
defined in the :setting:`DATABASES` definition in your settings and referred to
|
defined in the :setting:`DATABASES` definition in your settings and referred to
|
||||||
by at least one test through ``databases``.
|
by at least one test through ``databases``.
|
||||||
|
@ -1199,8 +1190,6 @@ The previous behavior of ``multi_db = True`` can be achieved by setting
|
||||||
|
|
||||||
.. attribute:: TestCase.databases
|
.. attribute:: TestCase.databases
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
By default, only the ``default`` database will be wrapped in a transaction
|
By default, only the ``default`` database will be wrapped in a transaction
|
||||||
during a ``TestCase``'s execution and attempts to query other databases will
|
during a ``TestCase``'s execution and attempts to query other databases will
|
||||||
result in assertion errors to prevent state leaking between tests.
|
result in assertion errors to prevent state leaking between tests.
|
||||||
|
@ -1563,8 +1552,6 @@ your test suite.
|
||||||
|
|
||||||
.. method:: SimpleTestCase.assertURLEqual(url1, url2, msg_prefix='')
|
.. method:: SimpleTestCase.assertURLEqual(url1, url2, msg_prefix='')
|
||||||
|
|
||||||
.. versionadded:: 2.2
|
|
||||||
|
|
||||||
Asserts that two URLs are the same, ignoring the order of query string
|
Asserts that two URLs are the same, ignoring the order of query string
|
||||||
parameters except for parameters with the same name. For example,
|
parameters except for parameters with the same name. For example,
|
||||||
``/path/?x=1&y=2`` is equal to ``/path/?y=2&x=1``, but
|
``/path/?x=1&y=2`` is equal to ``/path/?y=2&x=1``, but
|
||||||
|
|
Loading…
Reference in New Issue