mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[1.10.x] Fixed #26807 -- Documented how to replicate SubfieldBase's assignment behavior.
Backport of 518eaf1fa2 from master
			
			
This commit is contained in:
		| @@ -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`` | ||||
| -------------------------- | ||||
|   | ||||
		Reference in New Issue
	
	Block a user