From b9838c65ec2fee36c1fd0d46494ba44da27a9b34 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 3 May 2024 17:18:06 +0100 Subject: 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 Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> --- docs/internals/deprecation.txt | 2 ++ docs/releases/5.1.txt | 2 ++ 2 files changed, 4 insertions(+) (limited to 'docs') diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 4f89481ac7..1a74a2a46b 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -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 diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index 388487b322..bb5e4f3fe4 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -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 ======================= -- cgit v1.3