number of employee and some date)
                  
                  
                  2) PharmacyEmployee(where i have employee)
                  
                  
                  3) Pharmacy employee result(where i need do some logic and paste employee where employee need to work min 3 hours)
                  
                  
                  
                  
                  
                  pharmacies = PharmacyResult.objects.all()
                  
                  
                  when i do for loop 
                  
                  
                  for ph in pharmacies:
                  
                  
                  
                  
                  
                      pharmacy_employees = PharmacyEmployee.objects.all().filter(pharmacy=ph.pharmacy, date=ph.date)
                  
                  
                  
                  
                  
                           for employee in pharmacy_employees[0, ph.number_of_employees]: 
                  
                  
                                if employee.employee.workinghours <= 3:
                  
                  
                          
                  
                  
                                 pharmacy_employee = PharmacyEmployeeResult.objects.create(date=ph.date,
                  
                  
                                                                                        hour_from=ph.hour_from,
                  
                  
                                                                                        hour_to=ph.hour_to,
                  
                  
                                                                                        employee=employee.employee,
                  
                  
                                                                                        pharmacy=employee.pharmacy
                  
                  
                                                                                        )
                  
                  
                               pharmacy_employee.save()
                  
                  
                               employee.employee.workinghours += 1
                  
                  
                  
                  
                  
                  how can i put one employee third time to the other ph?
                  
                  
                
можете помочь с этим вопросом?)
Обсуждают сегодня