'After modifying a thing write the entire object to cache.
The caller must either pass in the read_modify_write lock or be acting
for a newly created thing (that has therefore never been cached before).'

def write_thing_to_cache(self, lock, brand_new_thing=False):

    assert (brand_new_thing or lock.have_lock)
    cache = self.__class__._cache
    key = self._cache_key()
    cache.set(key, self, time=self.__class__._cache_ttl)
