diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-11-30 05:30:43 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-11-30 05:30:43 +0000 |
| commit | 9e762f44078803f07f43b95cf8bdb0c1893cf7fa (patch) | |
| tree | 1475beba73d0a4c198dbb0ee2b55570c2eba620b /docs | |
| parent | 7ea174ef146157c363b667f18eee5dc920404b23 (diff) | |
Edited docs and docstring changes from [6572] (new cache add() method)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/cache.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/cache.txt b/docs/cache.txt index 6dfe2bf5ee..0cd847c3e5 100644 --- a/docs/cache.txt +++ b/docs/cache.txt @@ -370,16 +370,16 @@ get() can take a ``default`` argument:: >>> cache.get('my_key', 'has expired') 'has expired' -To add a key only if it doesn't already exist, there is an add() method. It -takes the same parameters as set(), but will not attempt to update the cache -if the key specified is already present:: +**New in Django development version:** To add a key only if it doesn't already +exist, use the ``add()`` method. It takes the same parameters as ``set()``, but +it will not attempt to update the cache if the key specified is already present:: >>> cache.set('add_key', 'Initial value') >>> cache.add('add_key', 'New value') >>> cache.get('add_key') 'Initial value' -There's also a get_many() interface that only hits the cache once. get_many() +There's also a ``get_many()`` interface that only hits the cache once. ``get_many()`` returns a dictionary with all the keys you asked for that actually exist in the cache (and haven't expired):: |
