-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in NestedUpdateMixin would be better to delete_reverse before update_or_create_reverse #50
Comments
totally agree, this is a duplicated of my issue #49 , take a look |
@isasiluispy @dz0 Hello! Thanks for the contribution. It really makes sense. I'll prepare a fix soon. |
I've found that your solution breaks some important tests. |
I've fixed another bug in delete method. Now, only one test is broken when I switch update and delete: This test covers functionality from this PR #36 |
@isasiluispy Your suggested fix brakes functionality from #36. I don't know how we can fix it saving backward compatibility for the moment. As for me, I don't understand the worth of #36, but a few people asked for this feature. |
To solve this problem, the logic in #36 needs to be moved into its own utility function and
Hopefully that helps someone who's motivated. I can't help ATM because I'm just here to evaluate the project as a replacement for our DIY logic. |
I think, if we have unique validator (let's say for field x),
and before request we had some related items
{"id":1, "x": 10},
{"id":2, "x": 5}
and in request
{
"id":42,
"stuf":"bar",
"related": [ {"id":2, "x": 10} ]
}
here we delete id=1, but the other "takes over" his value. (ps.: not tested)
so maybe switch the lines?
The text was updated successfully, but these errors were encountered: