Пример #1
0
 def delete_docs(cls, docs, all_or_nothing=False, empty_on_delete=False):
     super(_InvalidateCacheMixin,
           cls).bulk_delete(docs,
                            all_or_nothing=all_or_nothing,
                            empty_on_delete=empty_on_delete)
     for doc in docs:
         doc.clear_caches()
         invalidate_document(doc, deleted=True)
Пример #2
0
    def delete(self):
        id = self._id
        try:
            super(CachedCouchDocumentMixin, self).delete()
        except ResourceNotFound:
            # it was already deleted. this isn't a problem, but might be a caching bug
            logging.exception('Tried to delete cached doc %s but it was already deleted' % id)

        self._doc['_id'] = id
        invalidate_document(self, deleted=True)
Пример #3
0
    def delete(self):
        id = self._id
        try:
            super(_InvalidateCacheMixin, self).delete()
        except ResourceNotFound:
            # it was already deleted. this isn't a problem, but might be a caching bug
            logging.exception('Tried to delete cached doc %s but it was already deleted', id)

        self._doc['_id'] = id
        self.clear_caches()
        invalidate_document(self, couch_db=self.get_db(), deleted=True)
Пример #4
0
 def save_docs(cls, docs, use_uuids=True, all_or_nothing=False):
     super(CachedCouchDocumentMixin, cls).save_docs(docs, use_uuids, all_or_nothing)
     for doc in docs:
         invalidate_document(doc)
Пример #5
0
 def save(self, **params):
     super(CachedCouchDocumentMixin, self).save(**params)
     invalidate_document(self)
Пример #6
0
def invalidate_cached_domain(sender, domain, **kwargs):
    invalidate_document(domain)
Пример #7
0
def invalidate_cached_user(sender, couch_user, **kwargs):
    invalidate_document(couch_user)
Пример #8
0
 def clear_caches(self):
     invalidate_document(self)
Пример #9
0
 def clear_caches(self):
     invalidate_document(self, couch_db=self.get_db())
Пример #10
0
 def delete_docs(cls, docs, all_or_nothing=False, empty_on_delete=False):
     super(_InvalidateCacheMixin, cls).bulk_delete(
         docs, all_or_nothing=all_or_nothing, empty_on_delete=empty_on_delete)
     for doc in docs:
         doc.clear_caches()
         invalidate_document(doc, couch_db=cls.get_db(), deleted=True)
Пример #11
0
 def clear_caches(self):
     invalidate_document(self)
Пример #12
0
 def delete_docs(cls, docs, empty_on_delete=False):
     super(_InvalidateCacheMixin, cls).bulk_delete(
         docs, empty_on_delete=empty_on_delete)
     for doc in docs:
         doc.clear_caches()
         invalidate_document(doc, deleted=True)
Пример #13
0
def invalidate_cached_domain(sender, domain, **kwargs):
    invalidate_document(domain, couch_db=domain.get_db())