Skip to content

Commit 885a4bd

Browse files
committed
Deprecate Page.cache_key
1 parent ead3c02 commit 885a4bd

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

docs/deprecation.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,7 @@ No deprecations.
116116

117117
* The automatic discovery of subclasses of ``NavigationExtension`` has been
118118
replaced with an explicit mechanism of defining navigation extensions.
119+
120+
* ``Page.cache_key`` has never been used by FeinCMS itself and will therefore
121+
be removed in a future release. Comparable functionality has been available
122+
for a long time with ``Page.path_to_cache_key``.

docs/releases/1.11.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ New deprecations
9494
* The automatic discovery of subclasses of ``NavigationExtension`` has been
9595
replaced with an explicit mechanism of defining navigation extensions.
9696

97+
* ``Page.cache_key`` has never been used by FeinCMS itself and will therefore
98+
be removed in a future release. Comparable functionality has been available
99+
for a long time with ``Page.path_to_cache_key``.
100+
97101

98102
Notable features and improvements
99103
=================================

feincms/module/page/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from __future__ import absolute_import, unicode_literals
66

77
import re
8+
import warnings
89

910
from django.core.cache import cache as django_cache
1011
from django.core.exceptions import PermissionDenied
@@ -347,6 +348,11 @@ def cache_key(self):
347348
This function is here purely for your convenience. FeinCMS itself
348349
does not use it in any way.
349350
"""
351+
warnings.warn(
352+
'Page.cache_key has never been used and has therefore been'
353+
' deprecated and will be removed in a future release. Have a'
354+
' look at Page.path_to_cache_key if you require comparable'
355+
' functionality.', DeprecationWarning, stacklevel=2)
350356
return '-'.join(str(fn(self)) for fn in self.cache_key_components)
351357

352358
def etag(self, request):

0 commit comments

Comments
 (0)