1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +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:
Adam Johnson
2024-05-03 17:18:06 +01:00
committed by nessita
parent 15fff62d5d
commit b9838c65ec
8 changed files with 117 additions and 14 deletions

View File

@@ -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