aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitch Riedstra <Mitch@riedstra.us>2017-10-10 14:54:38 -0400
committerMitch Riedstra <Mitch@riedstra.us>2017-10-10 14:54:38 -0400
commit926acc9648b8d6093caf16a9624fd9e3e25e3e50 (patch)
tree04abcbea9b6fef175de73dee926f76026f73291d
parentc35399d201d8f64b54d00125cb658082dfee094b (diff)
downloaddispatch-tracker-926acc9648b8d6093caf16a9624fd9e3e25e3e50.tar.gz
dispatch-tracker-926acc9648b8d6093caf16a9624fd9e3e25e3e50.tar.xz
Initial version of extending context for driver view
-rw-r--r--app/dispatch/templates/dispatch/drivers/detail.html1
-rw-r--r--app/dispatch/views.py12
2 files changed, 13 insertions, 0 deletions
diff --git a/app/dispatch/templates/dispatch/drivers/detail.html b/app/dispatch/templates/dispatch/drivers/detail.html
index 97d6ff4..24afcc1 100644
--- a/app/dispatch/templates/dispatch/drivers/detail.html
+++ b/app/dispatch/templates/dispatch/drivers/detail.html
@@ -19,6 +19,7 @@
</div>
</div>
+
{% load dynamic_key %}
{% for date in loads %}
<div class="row">
diff --git a/app/dispatch/views.py b/app/dispatch/views.py
index 6ce552b..ea03355 100644
--- a/app/dispatch/views.py
+++ b/app/dispatch/views.py
@@ -99,6 +99,18 @@ class DriverDetail(LoadDateSort):
def test_func(self):
return self.request.user.is_superuser
+ def get_context_data(self, **kwargs):
+ # Shit gets fucky with super() really fast, but this seems to work
+ context = super(DriverDetail, self).get_context_data(**kwargs)
+
+ loads_by_date = context['loads']
+ for d in loads_by_date:
+ print(d)
+ for l in d:
+ print(l)
+
+ return context
+
class DriverUpdate(UpdateView):
template_name = "dispatch/drivers/edit.html"
model = User