Cache

evileg_core.cache.decorators module

evileg_core.cache.decorators.model_cached_property(method=None, timeout=60)[source]

Decorator for caching expensive properties in django models

WARNING: This decorator doesn`t work with dynamic objects in function arguments,ghgyyy For example it doesn`t work with AnonymousUser, only with authenticated Useryhhh

Parameters
  • timeout – cache timeout

  • method – wrapped method, which should be cached

Returns

wrapped function

evileg_core.cache.receivers module

evileg_core.cache.receivers.cache_invalidate_activity(sender, instance, **kwargs)[source]

evileg_core.cache.utils module

evileg_core.cache.utils.invalidate_model_cached_property(model_object, function)[source]

Function for invalidation model cached property

Parameters
  • model_object – model instance, on which should be invalidated property

  • function – wrapped function, which should be invalidated

Returns