Added shuttle roll
This commit is contained in:
@@ -34,6 +34,19 @@ class BusRollMixin:
|
|||||||
email_company.short_description = "Email Bus Roll to Company"
|
email_company.short_description = "Email Bus Roll to Company"
|
||||||
|
|
||||||
|
|
||||||
|
class ShuttleRollMixin:
|
||||||
|
|
||||||
|
def show_shuttle_roll(self, request, queryset):
|
||||||
|
if queryset is None:
|
||||||
|
buses = None
|
||||||
|
else:
|
||||||
|
buses = []
|
||||||
|
for shuttle in queryset:
|
||||||
|
if shuttle.bus not in buses:
|
||||||
|
buses.append(shuttle.bus)
|
||||||
|
return render_to_pdf('reports/bus_roll.html', bus_roll_context(buses, include_bus_stops=False))
|
||||||
|
|
||||||
|
|
||||||
class SchoolRollMixin:
|
class SchoolRollMixin:
|
||||||
|
|
||||||
def email_travellers_to_school(self, request, queryset):
|
def email_travellers_to_school(self, request, queryset):
|
||||||
@@ -311,8 +324,9 @@ class SettingAdmin(MyImportExportModelAdmin, admin.ModelAdmin):
|
|||||||
|
|
||||||
|
|
||||||
@admin.register(Shuttle)
|
@admin.register(Shuttle)
|
||||||
class ShuttleAdmin(MyImportExportModelAdmin, admin.ModelAdmin):
|
class ShuttleAdmin(MyImportExportModelAdmin, admin.ModelAdmin, ShuttleRollMixin):
|
||||||
list_display = ["__str__", "school", "bus", "shuttle_travellers"]
|
list_display = ["__str__", "school", "bus", "shuttle_travellers"]
|
||||||
|
actions = ["show_shuttle_roll"]
|
||||||
|
|
||||||
def shuttle_travellers(self, obj):
|
def shuttle_travellers(self, obj):
|
||||||
url = (
|
url = (
|
||||||
|
|||||||
Reference in New Issue
Block a user