aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/caf/models.py')
-rw-r--r--ctrack/caf/models.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index 78ebda7..5d7b5b0 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -79,11 +79,20 @@ class CAF(models.Model):
class Meta:
verbose_name = "CAF"
-
+
def get_absolute_url(self):
return reverse("caf:detail", kwargs={"pk": self.pk})
-
+ def applicable_systems(self):
+ """
+ Returns a Queryset of objects we can use in our templates.
+ """
+ return ApplicableSystem.objects.filter(caf=self)
+
+ def organisation(self):
+ first_ass = ApplicableSystem.objects.filter(caf=self).first()
+ return first_ass.organisation
+
def __str__(self):
# Get the organisation and applicable system
ass = ApplicableSystem.objects.filter(caf=self).first()