aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/views.py
diff options
context:
space:
mode:
authorMitch Riedstra <Mitch@riedstra.us>2017-10-09 22:32:36 -0400
committerMitch Riedstra <Mitch@riedstra.us>2017-10-09 22:32:36 -0400
commitaf6167f9d47182cc332ba4f4bdc65cc7ed890726 (patch)
tree0291084425fdc12daa8302998365f2ee6d5e5d27 /app/dispatch/views.py
parent5f137f66f19e60fb6f4b44a2d85076223e5837c5 (diff)
downloaddispatch-tracker-af6167f9d47182cc332ba4f4bdc65cc7ed890726.tar.gz
dispatch-tracker-af6167f9d47182cc332ba4f4bdc65cc7ed890726.tar.xz
Start the ugly process of cleaning up the views. Added a datepicker to the load date form. Added the 'load_number' field to the LoadCreate view
Diffstat (limited to 'app/dispatch/views.py')
-rw-r--r--app/dispatch/views.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/dispatch/views.py b/app/dispatch/views.py
index 2e5093e..9dd60af 100644
--- a/app/dispatch/views.py
+++ b/app/dispatch/views.py
@@ -49,10 +49,12 @@ class LoadDateSort(DetailView):
start_date, end_date, next_week, previous_week = get_week_dates(self.request.GET.get('date',None))
loads = self.get_object().load_set.filter(date__range=(start_date, end_date)).prefetch_related('company')
context['loads'] = split_loads_by_day(loads,start_date,end_date)
- context['start_date'] = formats.date_format(start_date, "SHORT_DATE_FORMAT")
- context['end_date'] = formats.date_format(end_date, "SHORT_DATE_FORMAT")
- context['next_week'] = formats.date_format(next_week, "SHORT_DATE_FORMAT")
- context['previous_week'] = formats.date_format(previous_week, "SHORT_DATE_FORMAT")
+
+ # Holy fucking shit this wasn't really necessary
+ context['start_date'] = start_date
+ context['end_date'] = end_date
+ context['next_week'] = next_week
+ context['previous_week'] = previous_week
return context
class FilteredListView(ListView):
@@ -157,7 +159,7 @@ class LoadCreate(CreateView):
template_name = "dispatch/loads/create.html"
model = Load
success_url = reverse_lazy('load_list')
- fields = ['date', 'company','description','amount']
+ fields = ['date', 'company', 'load_number', 'description','amount']
def get(self,request):
if request.user.is_superuser: