Skip to content
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 types for generic View mixins less strict #168

Merged

Conversation

mkurnikov
Copy link
Member

Fixes #152

@treyhunner, I believe this PR fixes 2 out of 3 errors presented in the issue. The last one, with the case of

class Mixin1:
    model: Type[Model]
class Mixin2:
    model: MyModel
class MyView(Mixin1, Mixin2):
    pass

is an upstream issue. See, for example, this one python/mypy#1237. The only thing we can do here is to make model an Any, which trading false-positive for false-negative, I don't know...

@mkurnikov mkurnikov merged commit 813dd8c into typeddjango:master Sep 17, 2019
@mkurnikov mkurnikov deleted the fix-some-errors-for-view-mixins branch September 17, 2019 20:30
voidus pushed a commit to voidus/django-stubs that referenced this pull request Apr 23, 2024
The `permission_set` reverse lookup was previously undefined on ContentType.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Class-based view mixin attributes have incompatible types
1 participant