Fixed #26807 -- Documented how to replicate SubfieldBase's assignment behavior.

This commit is contained in:
Tim Graham 2016-08-18 19:48:28 -04:00
parent f5c6d3c8d9
commit 518eaf1fa2
1 changed files with 7 additions and 3 deletions

View File

@ -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
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
:meth:`~django.db.models.Field.from_db_value`. Note that the new approach does
not call the :meth:`~django.db.models.Field.to_python` method on assignment
as was the case with ``SubfieldBase``.
:meth:`~django.db.models.Field.from_db_value`.
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``
--------------------------