Created new views and urls.

parent 686e1d01
......@@ -8,6 +8,9 @@ urlpatterns = [
path('schedule', schedule, name='schedule'),
path('report', report, name='report'),
path('receipt', receipt, name='receipt'),
path('addorder', addorder, name='addorder' ),
path('addorder', addorder, name='addorder'),
path('manager_query', manager_query, name='manager_query'),
path('week_query', week_query, name = 'week_query'),
path('role_query', role_query, name = 'role_query')
]
......@@ -22,30 +22,41 @@ def inventory(request):
def schedule(request):
# 1: FILTER EMPLOYEES BY MANAGER FOR THE DAY - mate
ismanager_query = EmployeeRole.objects.all().filter(is_manager='Y')
all_values = EmployeeRole.objects.all()
# 2: FILTER EMPLOYEES AND ROLES IN ALPHABETICAL ORDER - felizia
employee_role_order_query = EmployeeRole.objects.all().order_by('role_description')
# 3 : FILTER BY WEEK - dedz
week_query1 = EmployeeRole.objects.all().filter(role_date__range=["2025-09-01", "2025-09-06"]).order_by('role_date')
week_query2 = EmployeeRole.objects.all().filter(role_date__range=["2025-09-08", "2025-09-13"]).order_by('role_date')
# 4: FILTER EMPLOYEES BY ROLES - xtine
role_query1 = EmployeeRole.objects.all().filter(role_description='Cashier')
role_query2 = EmployeeRole.objects.all().filter(role_description='Preparation')
role_query3 = EmployeeRole.objects.all().filter(role_description='Cleaning')
# 5: FILTER EMPLOYEES AND ROLES BY DATE IN ORDER - xx
date_order_query = EmployeeRole.objects.all().order_by('role_date')
return render(request, "blizzardblast/templates/schedule.html", {
'manager': ismanager_query
'all_values': all_values
}
)
# 1: FILTER EMPLOYEES BY MANAGER FOR THE DAY - mate
def manager_query(request):
ismanager_query = EmployeeRole.objects.all().filter(is_manager='Y')
return render(request, "blizzardblast/templates/queries/manager_query.html", {'manager': ismanager_query})
# 3 : FILTER BY WEEK - dedz
def week_query(request):
week_query1 = EmployeeRole.objects.all().filter(role_date__range=["2025-09-01", "2025-09-06"]).order_by('role_date')
week_query2 = EmployeeRole.objects.all().filter(role_date__range=["2025-09-08", "2025-09-13"]).order_by('role_date')
return render(request, "blizzardblast/templates/queries/week_query.html", {
'week_query1': week_query1, 'week_query2': week_query2
}
)
# 4: FILTER EMPLOYEES BY ROLES - xtine
def role_query(request):
role_query1 = EmployeeRole.objects.all().filter(role_description='Cashier')
role_query2 = EmployeeRole.objects.all().filter(role_description='Preparation')
role_query3 = EmployeeRole.objects.all().filter(role_description='Cleaning')
return render(request, "blizzardblast/templates/queries/role_query.html", {
'cashier': role_query1, 'preparation':role_query2, 'cleaning':role_query3
}
)
def report(request):
return render(request, "blizzardblast/templates/report.html")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment