Changeset 6774 for django/trunk/docs/cache.txt
- Timestamp:
- 11/29/07 23:30:43 (1 year ago)
- Files:
-
- django/trunk/docs/cache.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/cache.txt
r6736 r6774 371 371 'has expired' 372 372 373 To add a key only if it doesn't already exist, there is an add() method. It 374 takes the same parameters as set(), but will not attempt to update the cache 375 i f the key specified is already present::373 **New in Django development version:** To add a key only if it doesn't already 374 exist, use the ``add()`` method. It takes the same parameters as ``set()``, but 375 it will not attempt to update the cache if the key specified is already present:: 376 376 377 377 >>> cache.set('add_key', 'Initial value') … … 380 380 'Initial value' 381 381 382 There's also a get_many() interface that only hits the cache once. get_many()382 There's also a ``get_many()`` interface that only hits the cache once. ``get_many()`` 383 383 returns a dictionary with all the keys you asked for that actually exist in the 384 384 cache (and haven't expired)::
