Use cachalot to invalidate caches

This commit is contained in:
2023-02-11 17:22:25 +00:00
parent dea1cfe889
commit 33d8e26c9b
19 changed files with 51 additions and 35 deletions

View File

@@ -418,23 +418,7 @@ class AssetGroup(models.Model):
allowed = models.JSONField(null=True, blank=True, default=dict)
def __str__(self):
return f"{self.name} ({self.restrictions})"
@property
def matches(self):
"""
Get the total number of matches for this group.
"""
if isinstance(self.allowed, dict):
truthy_values = [x for x in self.allowed.values() if x is True]
return f"{len(truthy_values)}/{len(self.allowed)}"
@property
def restrictions(self):
"""
Get the total number of restrictions for this group.
"""
return self.assetrestriction_set.count()
return f"{self.name}"
class AssetRestriction(models.Model):