-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Make SomeModel._default_manager return a BaseManager[SomeModel] instead of BaseManager[Model] #817
Changes from 2 commits
d4471e7
441650e
aac2361
4f798df
552f0c6
8a1c6e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ | |
class Base(Generic[_T]): | ||
def __init__(self, model_cls: Type[_T]): | ||
self.model_cls = model_cls | ||
reveal_type(self.model_cls._default_manager) # N: Revealed type is "django.db.models.manager.BaseManager[django.db.models.base.Model]" | ||
reveal_type(self.model_cls._default_manager) # N: Revealed type is "django.db.models.manager.BaseManager[_T`1]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm super unfamiliar with these types of tests. I hope the new test makes sense! |
||
class MyModel(models.Model): | ||
pass | ||
class Child(Base[MyModel]): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see
__get__
is usually anoverload
of two functions.You can take a look here: https://github.com/python/typeshed/