aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/caf/views.py
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-03-06 17:25:55 +0000
committerMatthew Lemon <matt@matthewlemon.com>2020-03-06 17:25:55 +0000
commitd901a8af93efa94545b5bd6ab7a323786923cb67 (patch)
tree32abc34c9c8420dd824d6a868fd2aa8c22a58ba1 /ctrack/caf/views.py
parent17ed627cc34955bc4a186d88ea34b8697177a763 (diff)
View for list of ApplicableSystems includes nis_poc - custom Manager
Diffstat (limited to 'ctrack/caf/views.py')
-rw-r--r--ctrack/caf/views.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py
index 23727d9..fceb869 100644
--- a/ctrack/caf/views.py
+++ b/ctrack/caf/views.py
@@ -20,15 +20,13 @@ class ListCAF(ListView):
class ListApplicableSystem(ListView):
model = ApplicableSystem
-
- # TODO - add primary_nis_contact tick to the context
- # Context can be easily found with:
- # org.person_set.filter(primary_nis_contact=True) or similar
- # probably need a custom manager for this - to add in the POC
+ # apparently you can pass a list of model objects to a template if you name it
+ # here - otherwise you need to provide a QuerySet
+ template_name = "caf/applicablesystem_list.html"
def get_queryset(self):
-# ess = ApplicableSystem.objects.all().order_by("organisation__name")
- ess = ApplicableSystem.objects.with_primary_contact()
+ # TODO sort this list using basic Python sorted()
+ ess = ApplicableSystem.objects.with_primary_contact() # returns a list, not a QuerySet
return ess
def get_context_data(self, **kwargs):