diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-11-11 21:23:45 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-11-11 21:23:45 +0100 |
| commit | 6c69de80bdcd2744bc64cb933c2d863dd5e74a33 (patch) | |
| tree | 1840ad52964897517559a069ec64ae7ad19a5e87 /django/core/cache/backends/base.py | |
| parent | 4c5cea70734fe8f4082c6a9bd8b26cf0a157ca78 (diff) | |
Tweaked cache key creation to avoid strict typing.
This is a provisional change. See #19221 for details.
Diffstat (limited to 'django/core/cache/backends/base.py')
| -rw-r--r-- | django/core/cache/backends/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py index 25fbbcbbdd..7234d3c4db 100644 --- a/django/core/cache/backends/base.py +++ b/django/core/cache/backends/base.py @@ -14,6 +14,7 @@ class InvalidCacheBackendError(ImproperlyConfigured): class CacheKeyWarning(DjangoRuntimeWarning): pass + # Memcached does not accept keys longer than this. MEMCACHE_MAX_KEY_LENGTH = 250 @@ -26,7 +27,7 @@ def default_key_func(key, key_prefix, version): the `key_prefix'. KEY_FUNCTION can be used to specify an alternate function with custom key making behavior. """ - return ':'.join([key_prefix, str(version), key]) + return '%s:%s:%s' % (key_prefix, version, key) def get_key_func(key_func): |
