Fixed #26807 -- Documented how to replicate SubfieldBase's assignment behavior.
This commit is contained in:
parent
f5c6d3c8d9
commit
518eaf1fa2
|
@ -1477,9 +1477,13 @@ It's a legacy option that should no longer be necessary.
|
||||||
will be removed in Django 1.10. Historically, it was used to handle fields where
|
will be removed in Django 1.10. Historically, it was used to handle fields where
|
||||||
type conversion was needed when loading from the database, but it was not used
|
type conversion was needed when loading from the database, but it was not used
|
||||||
in ``.values()`` calls or in aggregates. It has been replaced with
|
in ``.values()`` calls or in aggregates. It has been replaced with
|
||||||
:meth:`~django.db.models.Field.from_db_value`. Note that the new approach does
|
:meth:`~django.db.models.Field.from_db_value`.
|
||||||
not call the :meth:`~django.db.models.Field.to_python` method on assignment
|
|
||||||
as was the case with ``SubfieldBase``.
|
The new approach doesn't call the :meth:`~django.db.models.Field.to_python`
|
||||||
|
method on assignment as was the case with ``SubfieldBase``. If you need that
|
||||||
|
behavior, reimplement the ``Creator`` class `from Django's source code
|
||||||
|
<https://github.com/django/django/blob/stable/1.8.x/django/db/models/fields/subclassing.py#L31-L44>`_
|
||||||
|
in your project.
|
||||||
|
|
||||||
``django.utils.checksums``
|
``django.utils.checksums``
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
Loading…
Reference in New Issue