I have two model employee and department. Employee has one to one connection with department like
class Employee(models.Model):
department = models.ForeignKey(to=Department, on_delete=models.CASCADE)
but when I try to create object from rest request, it throws
ValueError: Cannot assign "{'id': 1, 'name': 'wrewrwerwe'}": "Employee.department" must be a "Department" instance.
Employeemodel object.