Beispiel #1
0
 def invalidate_cache(self):
     """
     Invalidates this objects cached metadata.
     """
     cache.delete_memoized(self.get_post_count, self)
     cache.delete_memoized(self.get_first_post, self)
     cache.delete_memoized(self.get_last_post, self)
Beispiel #2
0
 def invalidate_cache(self):
     """
     Invalidates this objects, and it's parents', cached metadata.
     """
     _forum = self
     while _forum.parent:
         cache.delete_memoized(self.get_post_count, _forum)
         cache.delete_memoized(self.get_topic_count, _forum)
         cache.delete_memoized(self.get_last_post, _forum)
         _forum = _forum.parent
Beispiel #3
0
    def invalidate_cache(self, permissions=True, messages=True):
        """Invalidates this objects cached metadata.

        :param permissions_only: If set to ``True`` it will only invalidate
                                 the permissions cache. Otherwise it will
                                 also invalidate the user's unread message
                                 cache.
        """
        if messages:
            cache.delete_memoized(self.get_unread_messages, self)

        if permissions:
            cache.delete_memoized(self.get_permissions, self)
            cache.delete_memoized(self.get_groups, self)
Beispiel #4
0
    def invalidate_cache(self, permissions=True, messages=True):
        """Invalidates this objects cached metadata.

        :param permissions_only: If set to ``True`` it will only invalidate
                                 the permissions cache. Otherwise it will
                                 also invalidate the user's unread message
                                 cache.
        """
        if messages:
            cache.delete_memoized(self.get_unread_messages, self)

        if permissions:
            cache.delete_memoized(self.get_permissions, self)
            cache.delete_memoized(self.get_groups, self)
Beispiel #5
0
    def invalidate_cache(cls):
        """Invalidates this objects cached metadata."""

        cache.delete_memoized(cls.get_permissions, cls)
Beispiel #6
0
    def invalidate_cache(cls):
        """Invalidates this objects cached metadata."""

        cache.delete_memoized(cls.get_permissions, cls)
Beispiel #7
0
 def invalidate_cache(self):
     """Invalidates this objects cached metadata."""
     cache.delete_memoized(self.get_permissions, self)
     cache.delete_memoized(self.get_groups, self)
Beispiel #8
0
 def invalidate_cache(cls):
     """Invalidates this objects cached metadata."""
     cache.delete_memoized(cls.as_dict, cls)
Beispiel #9
0
 def invalidate_cache(cls):
     """Invalidates this objects cached metadata."""
     cache.delete_memoized(cls.as_dict, cls)
Beispiel #10
0
    def invalidate_cache(self):
        """Invalidates this objects cached metadata."""

        cache.delete_memoized(self.get_permissions, self)
        cache.delete_memoized(self.get_groups, self)
Beispiel #11
0
def invalidate_cache(user):
    """Invalidates the cache."""
    cache.delete_memoized(get_message_count, user)
    cache.delete_memoized(get_unread_count, user)
    cache.delete_memoized(get_latest_messages, user)
Beispiel #12
0
 def invalidate_cache_for_all(cls):
     cache.delete_memoized(cls.get_permissions)
     cache.delete_memoized(cls.get_groups)