Add exists method to cache file model

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-07-26 02:22:50 -04:00
parent 150c5d8cc2
commit 3a7025d9c4

View File

@@ -210,6 +210,9 @@ class CachePartitionFile(models.Model):
self.partition.cache.storage.delete(name=self.full_filename) self.partition.cache.storage.delete(name=self.full_filename)
return super(CachePartitionFile, self).delete(*args, **kwargs) return super(CachePartitionFile, self).delete(*args, **kwargs)
def exists(self):
return self.partition.cache.storage.exists(name=self.full_filename)
@cached_property @cached_property
def full_filename(self): def full_filename(self):
return CachePartition.get_combined_filename( return CachePartition.get_combined_filename(