You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expect a QuerySet for multiple defaults in MultipleObjectMixin (#2191)
When `MultipleObjectMixin` adds a more specific type than "something
that can be sliced" (i.e. `_SupportsPagination`) for default types of
queryset attributes/arguments a couple of subclass views gets a better
default behaviour.
Copy file name to clipboardExpand all lines: tests/typecheck/views/generic/test_list.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -48,5 +48,5 @@
48
48
...
49
49
out: |
50
50
main:7: error: Incompatible types in assignment (expression has type "Type[MyModel]", base class "MultipleObjectMixin" defined the type as "Optional[Type[Other]]") [assignment]
51
-
main:8: error: Incompatible types in assignment (expression has type "QuerySet[MyModel, MyModel]", base class "MultipleObjectMixin" defined the type as "Optional[_SupportsPagination[Other]]") [assignment]
52
-
main:10: error: Return type "QuerySet[MyModel, MyModel]" of "get_queryset" incompatible with return type "_SupportsPagination[Other]" in supertype "MultipleObjectMixin" [override]
51
+
main:8: error: Incompatible types in assignment (expression has type "QuerySet[MyModel, MyModel]", base class "MultipleObjectMixin" defined the type as "Optional[QuerySet[Other, Other]]") [assignment]
52
+
main:10: error: Return type "QuerySet[MyModel, MyModel]" of "get_queryset" incompatible with return type "QuerySet[Other, Other]" in supertype "MultipleObjectMixin" [override]
0 commit comments