diff --git a/apiserver/scripts/export_class_report.py b/apiserver/scripts/export_class_report.py index 834c7a6..4b1459c 100755 --- a/apiserver/scripts/export_class_report.py +++ b/apiserver/scripts/export_class_report.py @@ -8,7 +8,7 @@ from apiserver.api import models sessions = models.Session.objects.filter(datetime__gte='2021-01-01') with open('output.csv', 'w', newline='') as csvfile: - fields = ['date', 'name', 'num_students'] + fields = ['date', 'name', 'num_students','attended'] writer = csv.DictWriter(csvfile, fieldnames=fields) writer.writeheader() @@ -17,6 +17,7 @@ with open('output.csv', 'w', newline='') as csvfile: writer.writerow(dict( date=s.datetime.date(), name=s.course.name, - num_students=s.students.filter(attendance_status='Attended').count(), + num_students=s.students.count(), + attended=s.students.filter(attendance_status='Attended').count(), ))