Explorar o código

Documented that cache keys are strings rather than bytes.

Adam Chainz %!s(int64=8) %!d(string=hai) anos
pai
achega
968f61b991
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      docs/topics/cache.txt

+ 3 - 0
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