You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
644 B
Python
17 lines
644 B
Python
from django.shortcuts import render
|
|
from django.views.generic import TemplateView
|
|
|
|
from containers.models import Container
|
|
|
|
|
|
class BarrierDashboardView(TemplateView):
|
|
template_name = 'barrier/barrier-dashboard.html'
|
|
|
|
def get_context_data(self, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
recent_containers = Container.objects.select_related('line', 'booking').order_by('-expedited_on', '-received_on')[:10]
|
|
context['recent_containers'] = recent_containers
|
|
return context
|
|
|
|
def get(self, request, *args, **kwargs):
|
|
return render(request, self.template_name, self.get_context_data()) |