Added date selector to shuttles and traveller counts

This commit is contained in:
John Mullins
2024-12-13 09:36:41 +11:00
parent 320303f95f
commit dabce7f360
3 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -85,10 +85,10 @@ class Bus(models.Model):
def __str__(self):
return f"{self.route_name}"
def traveller_count(self):
def traveller_count(self, date=None):
count = 0
for traveller in Traveller.objects.filter(bus_stops__bus=self):
if traveller._is_active():
if traveller._is_active(date):
count += 1
return count