You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create a mock model that has some PKs, it fails with:
ValueError: Cannot assign "mock-pizza-1": "MyModel.pizzas" must be a "Pizza" instance
Could have something to do with this. Is there a good way to do this ?
An implementation option would be to remove all relations from the save method, and putting them somewhere else, so when you try to access them, you access them from that place. This is a philosophy that is used in some DRF nested serializers.
The text was updated successfully, but these errors were encountered:
@MartinGotelli At least the message looks like this. I am going to close this issue as solved. If this is indeed a different issue, re-opening the issue once there are more reproduction details should be no big deal.
When trying to create a mock model that has some PKs, it fails with:
ValueError: Cannot assign "mock-pizza-1": "MyModel.pizzas" must be a "Pizza" instance
Could have something to do with this. Is there a good way to do this ?
An implementation option would be to remove all relations from the
save
method, and putting them somewhere else, so when you try to access them, you access them from that place. This is a philosophy that is used in some DRF nested serializers.The text was updated successfully, but these errors were encountered: