Initial work on productions dashboard

This commit is contained in:
2022-12-16 14:06:06 +00:00
parent eb07990f4c
commit e100f5a1d4
5 changed files with 65 additions and 12 deletions

View File

@@ -4,3 +4,4 @@ from .hs import *
from .ical import *
from .rigboard import *
from .subhire import *
from .dashboards import *

14
RIGS/views/dashboards.py Normal file
View File

@@ -0,0 +1,14 @@
from django.views import generic
from RIGS import models
class ProductionsDashboard(generic.TemplateView):
template_name = 'dashboards/productions.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['page_title'] = "Productions Dashboard"
context['rig_count'] = models.Event.objects.rig_count()
context['subhire_count'] = models.Subhire.objects.event_count()
context['hire_count'] = models.Event.objects.active_dry_hires().count()
return context