Added shuttles to bus roll
This commit is contained in:
@@ -34,9 +34,16 @@ def bus_roll_context(queryset=None):
|
||||
}
|
||||
bus_route.append(stop_result)
|
||||
|
||||
# Todo Add shuttles
|
||||
shuttle_travellers = []
|
||||
has_shuttle = False
|
||||
for shuttle in Shuttle.objects.filter(bus=bus):
|
||||
has_shuttle = True
|
||||
for traveller in Traveller.objects.filter(shuttle=shuttle):
|
||||
shuttle_travellers.append({
|
||||
'display': f"{traveller} ({traveller.get_year_level_display()}, {traveller.school})",
|
||||
})
|
||||
|
||||
bus_routes.append({'bus': bus, 'stops': bus_route})
|
||||
bus_routes.append({'bus': bus, 'stops': bus_route, 'has_shuttle': has_shuttle, 'shuttle_travellers': shuttle_travellers})
|
||||
return {'routes': bus_routes}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user