Exemplo n.º 1
0
def flush_similar_cache_handler(sender, **kwargs):
    """
    Flush the cache of similar entries when an entry is saved.
    """
    entry = kwargs['instance']
    if entry.is_visible:
        EntryPublishedVectorBuilder().cache_flush()
Exemplo n.º 2
0
 def make_hidden(self, request, queryset):
     """
     Set entries selected as hidden.
     """
     queryset.update(status=HIDDEN)
     EntryPublishedVectorBuilder().cache_flush()
     self.message_user(request,
                       _('The selected entries are now marked as hidden.'))
Exemplo n.º 3
0
 def make_published(self, request, queryset):
     """
     Set entries selected as published.
     """
     queryset.update(status=PUBLISHED)
     EntryPublishedVectorBuilder().cache_flush()
     self.ping_directories(request, queryset, messages=False)
     self.message_user(
         request, _('The selected entries are now marked as published.'))