1👍
Try:
company = Company.objects.get(id=company_id)
employee, created = Employee.objects.get_or_create(name=emp_name, phone_number=emp_phone_number,company=company)
employee.save()
Source:stackexchange.com
1👍
Try:
company = Company.objects.get(id=company_id)
employee, created = Employee.objects.get_or_create(name=emp_name, phone_number=emp_phone_number,company=company)
employee.save()