forrowinEmployeeRole.objects.raw('''SELECT role_id,employee_name, role_date FROM employeerole RIGHT JOIN employee ON (employeerole.employee_id=employee.employee_id)
WHERE role_description ILIKE 'cashier' '''):
print(row.employee_name,row.role_description,row.role_date,'- filter by roles')
# filter employees by manager for the day
forrowinEmployeeRole.objects.raw('''SELECT role_id,employee_name, role_date FROM employeerole RIGHT JOIN employee ON (employeerole.employee_id=employee.employee_id)
WHERE is_manager ILIKE 'Y' '''):
print(row.employee_name,row.role_description,row.role_date,'- manager for the day')
# filter employees by week
forrowinEmployeeRole.objects.raw('''SELECT * FROM employeerole RIGHT JOIN employee ON (employeerole.employee_id=employee.employee_id)
WHERE role_date <= '2025-09-06' AND role_date >= '2025-09-01' ORDER BY role_date '''):
pass
# employeeroles = {}
# for role in EmployeeRole.objects.raw('''SELECT * FROM employeerole'''):
# print dates when they're managers
# if role.is_manager == 'Y':
# print(role.employee.employee_name, 'is a manager on', role.role_date)
#
# employeename = role.employee.employee_name
# employeerole = role.role_description
# day_mgr = []
# if role.employee.employee_name not in employeeroles: