Open pavel-vorobyev opened 3 weeks ago
Yeah, there is some problem with query generation, this alias doesn't seem right, I'll try to look into it later
For now you can do the same with subquery
user = await User.create(internal_id=2)
await UserInfo.create(rank=1, user=user)
await UserInfo.filter(
user_id__in=Subquery(User.filter(internal_id=2).values("id"))
).update(rank=5)
Describe the bug I have two models. They are related via
OneToOneField
.When I try to update
UserInfo
by user'sinternal_id
I got an error:SQL Query:
If I call just
filter
withoutupdate
it works fine. It returnsUserInfo
object:Expected behavior Update request executes successfully.