-
I want to work with typehints, but unfortunately |
Beta Was this translation helpful? Give feedback.
Answered by
collerek
Feb 20, 2021
Replies: 1 comment 2 replies
-
Yeah I noticed it some time ago and I want to update the types with Generics so it should work better. You can open an issue with types update so it won't be missed along other tasks. As a immediate yet quite ugly solution you can cast the returned instance to proper type like this: from typing import cast
instance = UserModel.objects.get()
instance = cast(UserModel, instance) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
collerek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah I noticed it some time ago and I want to update the types with Generics so it should work better. You can open an issue with types update so it won't be missed along other tasks.
As a immediate yet quite ugly solution you can cast the returned instance to proper type like this: