Django

Code

Show
Ignore:
Timestamp:
11/29/07 23:30:43 (1 year ago)
Author:
adrian
Message:

Edited docs and docstring changes from [6572] (new cache add() method)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/cache.txt

    r6736 r6774  
    371371    'has expired' 
    372372 
    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 if the key specified is already present:: 
     373**New in Django development version:** To add a key only if it doesn't already 
     374exist, use the ``add()`` method. It takes the same parameters as ``set()``, but 
     375it will not attempt to update the cache if the key specified is already present:: 
    376376 
    377377    >>> cache.set('add_key', 'Initial value') 
     
    380380    'Initial value' 
    381381 
    382 There's also a get_many() interface that only hits the cache once. get_many() 
     382There's also a ``get_many()`` interface that only hits the cache once. ``get_many()`` 
    383383returns a dictionary with all the keys you asked for that actually exist in the 
    384384cache (and haven't expired)::