summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdam Chainz <adam@adamj.eu>2016-10-06 18:01:19 +0100
committerTim Graham <timograham@gmail.com>2016-10-27 15:49:24 -0400
commit968f61b99180a17e1752432df38f28f192c6cf86 (patch)
tree526d998d2ded67710d7f2856276d28304bf98adf /docs
parent4584bc3a1e3d610eb001cdfffa8ef18863fc03d3 (diff)
Documented that cache keys are strings rather than bytes.
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/cache.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index ec90d89bba..9683a44931 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -803,6 +803,9 @@ The basic interface is ``set(key, value, timeout)`` and ``get(key)``::
>>> cache.get('my_key')
'hello, world!'
+``key`` should be a ``str`` (or ``unicode`` on Python 2), and ``value`` can be
+any picklable Python object.
+
The ``timeout`` argument is optional and defaults to the ``timeout`` argument
of the appropriate backend in the :setting:`CACHES` setting (explained above).
It's the number of seconds the value should be stored in the cache. Passing in