mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #35405 -- Converted get_cache_name into a cached property in FieldCacheMixin.
FieldCacheMixin is used by related fields to track their cached values. This work migrates get_cache_name() to be a cached property to optimize performance by reducing unnecessary function calls when working with related fields, given that its value remains constant. Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
This commit is contained in:
@@ -82,6 +82,8 @@ details on these changes.
|
||||
* The ``OS_OPEN_FLAGS`` attribute of
|
||||
:class:`~django.core.files.storage.FileSystemStorage` will be removed.
|
||||
|
||||
* The ``get_cache_name()`` method of ``FieldCacheMixin`` will be removed.
|
||||
|
||||
.. _deprecation-removed-in-5.1:
|
||||
|
||||
5.1
|
||||
|
||||
@@ -474,6 +474,8 @@ Miscellaneous
|
||||
overwriting files in storage, set the new
|
||||
:attr:`~django.core.files.storage.FileSystemStorage.allow_overwrite` option
|
||||
to ``True`` instead.
|
||||
* The ``get_cache_name()`` method of ``FieldCacheMixin`` is deprecated in favor
|
||||
of the ``cache_name`` cached property.
|
||||
|
||||
Features removed in 5.1
|
||||
=======================
|
||||
|
||||
Reference in New Issue
Block a user