Commit a0555d4c by Calen Pennington

Add more documentation to DjangoOrmFieldCache

parent 7a9923e2
......@@ -197,10 +197,26 @@ class DjangoOrmFieldCache(object):
@contract(kvs_key=DjangoKeyValueStore.Key)
def get(self, kvs_key):
"""
Return the django model object specified by `kvs_key` from
the cache.
Arguments:
kvs_key (`DjangoKeyValueStore.Key`): The field value to delete
Returns: A django orm object from the cache
"""
return self._cache.get(self._cache_key_for_kvs_key(kvs_key))
@contract(kvs_key=DjangoKeyValueStore.Key)
def set(self, kvs_key, value):
"""
Set the specified `kvs_key` to the django model object `value`.
Arguments:
kvs_key (`DjangoKeyValueStore.Key`): The field value to delete
value: The django orm object to be stored in the cache
"""
self._cache[self._cache_key_for_kvs_key(kvs_key)] = value
@contract(kvs_key=DjangoKeyValueStore.Key)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment