mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Adapted uses of versionchanged/versionadded to the new form.
Refs #20104.
This commit is contained in:
parent
1ddeeb5b8e
commit
78c842a323
48 changed files with 206 additions and 148 deletions
|
@ -378,6 +378,7 @@ If you need to accept :attr:`~Field.null` values then use
|
|||
:class:`NullBooleanField` instead.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
The default value of ``BooleanField`` was changed from ``False`` to
|
||||
``None`` when :attr:`Field.default` isn't defined.
|
||||
|
||||
|
@ -956,8 +957,8 @@ Like all :class:`CharField` subclasses, :class:`URLField` takes the optional
|
|||
|
||||
.. versionadded:: 1.5
|
||||
|
||||
The current value of the field will be displayed as a clickable link above the
|
||||
input widget.
|
||||
The current value of the field will be displayed as a clickable link above the
|
||||
input widget.
|
||||
|
||||
|
||||
Relationship fields
|
||||
|
|
|
@ -297,8 +297,9 @@ follows this algorithm:
|
|||
didn't update anything, Django executes an ``INSERT``.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
Previously Django used ``SELECT`` - if not found ``INSERT`` else ``UPDATE``
|
||||
algorithm. The old algorithm resulted in one more query in ``UPDATE`` case.
|
||||
|
||||
Previously Django used ``SELECT`` - if not found ``INSERT`` else ``UPDATE``
|
||||
algorithm. The old algorithm resulted in one more query in ``UPDATE`` case.
|
||||
|
||||
The one gotcha here is that you should be careful not to specify a primary-key
|
||||
value explicitly when saving new objects, if you cannot guarantee the
|
||||
|
|
|
@ -554,11 +554,13 @@ Returns a ``DateQuerySet`` — a ``QuerySet`` that evaluates to a list of
|
|||
particular kind within the contents of the ``QuerySet``.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
``dates`` used to return a list of :class:`datetime.datetime` objects.
|
||||
|
||||
``field`` should be the name of a ``DateField`` of your model.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
|
||||
``dates`` used to accept operating on a ``DateTimeField``.
|
||||
|
||||
``kind`` should be either ``"year"``, ``"month"`` or ``"day"``. Each
|
||||
|
@ -1121,11 +1123,11 @@ to ``defer()``::
|
|||
|
||||
.. versionchanged:: 1.5
|
||||
|
||||
Some fields in a model won't be deferred, even if you ask for them. You can
|
||||
never defer the loading of the primary key. If you are using
|
||||
:meth:`select_related()` to retrieve related models, you shouldn't defer the
|
||||
loading of the field that connects from the primary model to the related
|
||||
one, doing so will result in an error.
|
||||
Some fields in a model won't be deferred, even if you ask for them. You can
|
||||
never defer the loading of the primary key. If you are using
|
||||
:meth:`select_related()` to retrieve related models, you shouldn't defer the
|
||||
loading of the field that connects from the primary model to the related
|
||||
one, doing so will result in an error.
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -1193,20 +1195,20 @@ logically::
|
|||
# existing set of fields).
|
||||
Entry.objects.defer("body").only("headline", "body")
|
||||
|
||||
.. versionchanged:: 1.5
|
||||
|
||||
All of the cautions in the note for the :meth:`defer` documentation apply to
|
||||
``only()`` as well. Use it cautiously and only after exhausting your other
|
||||
options. Also note that using :meth:`only` and omitting a field requested
|
||||
using :meth:`select_related` is an error as well.
|
||||
options.
|
||||
|
||||
.. versionchanged:: 1.5
|
||||
|
||||
.. note::
|
||||
Using :meth:`only` and omitting a field requested using
|
||||
:meth:`select_related` is an error as well.
|
||||
|
||||
When calling :meth:`~django.db.models.Model.save()` for instances with
|
||||
deferred fields, only the loaded fields will be saved. See
|
||||
:meth:`~django.db.models.Model.save()` for more details.
|
||||
.. note::
|
||||
|
||||
When calling :meth:`~django.db.models.Model.save()` for instances with
|
||||
deferred fields, only the loaded fields will be saved. See
|
||||
:meth:`~django.db.models.Model.save()` for more details.
|
||||
|
||||
using
|
||||
~~~~~
|
||||
|
@ -1424,6 +1426,7 @@ query. The default is to create all objects in one batch, except for SQLite
|
|||
where the default is such that at maximum 999 variables per query is used.
|
||||
|
||||
.. versionadded:: 1.5
|
||||
|
||||
The ``batch_size`` parameter was added in version 1.5.
|
||||
|
||||
count
|
||||
|
@ -1725,7 +1728,8 @@ methods on your models. It does, however, emit the
|
|||
(including cascaded deletions).
|
||||
|
||||
.. versionadded:: 1.5
|
||||
Allow fast-path deletion of objects
|
||||
|
||||
Allow fast-path deletion of objects.
|
||||
|
||||
Django needs to fetch objects into memory to send signals and handle cascades.
|
||||
However, if there are no cascades and no signals, then Django may take a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue