Advanced deprecations in core.cache.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2011-04-02 08:37:15 +00:00
parent 24b7d9017d
commit 576606a6f2
3 changed files with 16 additions and 16 deletions

View File

@ -80,7 +80,7 @@ if not settings.CACHES:
import warnings
warnings.warn(
"settings.CACHE_* is deprecated; use settings.CACHES instead.",
PendingDeprecationWarning
DeprecationWarning
)
else:
# The default cache setting is put here so that we

View File

@ -126,24 +126,18 @@ class BaseMemcachedCache(BaseCache):
def clear(self):
self._cache.flush_all()
# For backwards compatibility -- the default cache class tries a
# cascading lookup of cmemcache, then memcache.
class CacheClass(BaseMemcachedCache):
def __init__(self, server, params):
warnings.warn(
"memcached.CacheClass has been split into memcached.MemcachedCache and memcached.PyLibMCCache. Please update your cache backend setting.",
PendingDeprecationWarning
)
try:
import cmemcache as memcache
import warnings
warnings.warn(
"Support for the 'cmemcache' library has been deprecated. Please use python-memcached or pyblimc instead.",
DeprecationWarning
)
except ImportError:
try:
import memcache
except:
raise InvalidCacheBackendError(
"Memcached cache backend requires either the 'memcache' or 'cmemcache' library"
)
import memcache
except:
raise InvalidCacheBackendError(
"Memcached cache backend requires either the 'memcache' or 'cmemcache' library"
)
super(CacheClass, self).__init__(server, params,
library=memcache,
value_not_found_exception=ValueError)

View File

@ -186,6 +186,12 @@ their deprecation, as per the :ref:`Django deprecation policy
synonym for ``django.views.decorators.csrf.csrf_exempt``, which should
be used to replace it.
* The :class:`~django.core.cache.backends.memcached.CacheClass` backend
was split into two in Django 1.3 in order to introduce support for
PyLibMC. The historical :class:`~django.core.cache.backends.memcached.CacheClass`
is now an alias for :class:`~django.core.cache.backends.memcached.MemcachedCache`.
In Django 1.6, the historical alias will be removed.
* 2.0
* ``django.views.defaults.shortcut()``. This function has been moved
to ``django.contrib.contenttypes.views.shortcut()`` as part of the