aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-02 14:06:22 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-02 14:06:22 +0100
commita38fce358643f5f8e1b2d7ec8e17342f760e16d4 (patch)
tree768c80bf2a9df477cc17227f2ae813b44c1f3c52 /ctrack/caf/models.py
parent844804083d74731c6f275b25f01e6085271edc9e (diff)
Now lists basic CAF events on CAF detail page
Diffstat (limited to 'ctrack/caf/models.py')
-rw-r--r--ctrack/caf/models.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index d5ae98a..5e3e2e2 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -4,6 +4,8 @@ from ctrack.caf.managers import ApplicableSystemManager
from ctrack.organisations.models import Organisation, Person
from django.urls.base import reverse
+from ctrack.register.models import EngagementEvent
+
class Grading(models.Model):
GRADING_TYPE = [
@@ -158,6 +160,8 @@ class CAF(models.Model):
def get_assessments(self):
return self.cafassessment_set.all()
+ def get_events(self):
+ return EngagementEvent.objects.filter(related_caf=self).all().order_by("-date")
def __str__(self):
# Get the organisation and applicable system