=== modified file 'lava_scheduler_app/views.py'
@@ -26,6 +26,7 @@
from django.utils.html import escape
from django.utils.safestring import mark_safe
from django.db import models
+from django.db.models import Q
from django_tables2 import Attrs, Column
@@ -296,7 +297,7 @@
The value is defined when table instance is created in device_type_detail()
"""
- def render_name(self, record):
+ def render_Duration(self, record):
matrix = {-24:"24hours", -24*7:"Week", -24*7*30:"Month"}
return matrix[record]
@@ -315,7 +316,7 @@
TestJob.CANCELED, TestJob.CANCELING]).count()
return num
- name = Column()
+ Duration = Column()
Complete = Column()
Failed = Column()
@@ -343,11 +344,10 @@
'running_jobs_num': TestJob.objects.filter(
actual_device__in=Device.objects.filter(device_type=dt),
status=TestJob.RUNNING).count(),
- # Fix me: doesn't count actual_device not set but requested
- # device type jobs.
'queued_jobs_num': TestJob.objects.filter(
- actual_device__in=Device.objects.filter(device_type=dt),
- status=TestJob.SUBMITTED).count(),
+ Q(status=TestJob.SUBMITTED), Q(requested_device_type=dt)
+ | Q(requested_device__in=Device.objects.filter(device_type=dt))
+ ).count(),
# data return 1 day, 1 week, 1 month offset
'health_job_summary_table': HealthJobSummaryTable(
'device_type', params=(dt,), data=[-24, -24*7, -24*7*30]),