diff options
| author | Adam Johnson <me@adamj.eu> | 2024-05-03 17:18:06 +0100 |
|---|---|---|
| committer | nessita <124304+nessita@users.noreply.github.com> | 2024-05-21 16:19:29 -0300 |
| commit | b9838c65ec2fee36c1fd0d46494ba44da27a9b34 (patch) | |
| tree | 27ce165d7e8db3efc34204170abc320c8f284c25 /docs | |
| parent | 15fff62d5d8f28b6b61d63341535c9aafc64c865 (diff) | |
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>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 2 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 2 |
2 files changed, 4 insertions, 0 deletions
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 ======================= |
