Exemplo n.º 1
0
def update_cache(sender, instance, **kwargs):
    cache_key = get_cache_key(instance.document, instance.revision)
    discussion_length = Note.objects \
        .filter(document=instance.document) \
        .filter(revision=instance.revision) \
        .count()
    cache.set(cache_key, discussion_length, None)
Exemplo n.º 2
0
def update_cache(sender, instance, **kwargs):
    cache_key = get_cache_key(instance.document, instance.revision)
    discussion_length = Note.objects \
        .filter(document=instance.document) \
        .filter(revision=instance.revision) \
        .count()
    cache.set(cache_key, discussion_length, None)
Exemplo n.º 3
0
def clear_cache(sender, instance, **kwargs):
    cache_key = get_cache_key(instance.document, instance.revision)
    cache.delete(cache_key)
Exemplo n.º 4
0
def clear_cache(sender, instance, **kwargs):
    cache_key = get_cache_key(instance.document, instance.revision)
    cache.delete(cache_key)