diff options
Diffstat (limited to 'src/resource_inventory/models.py')
-rw-r--r-- | src/resource_inventory/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/resource_inventory/models.py b/src/resource_inventory/models.py index 557a4fc..4a6375d 100644 --- a/src/resource_inventory/models.py +++ b/src/resource_inventory/models.py @@ -14,6 +14,7 @@ from django.db import models from django.db.models import Q import re +from collections import Counter from account.models import Lab from dashboard.utils import AbstractModelQuery @@ -169,6 +170,10 @@ class ResourceTemplate(models.Model): configs = self.resourceConfigurations.all() return list(configs) + def get_required_resources(self): + profiles = Counter([str(config.profile) for config in self.getConfigs()]) + return dict(profiles) + def __str__(self): return self.name |