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
# mypy .
hordak/views/accounts.py:86: error: Definition of "context_object_name" in base class "SingleObjectMixin" is incompatible with definition in base class "MultipleObjectMixin"
hordak/views/accounts.py:86: error: Definition of "queryset" in base class "SingleObjectMixin" is incompatible with definition in base class "MultipleObjectMixin"
Found 2 errors in 1 file (checked 56 source files)
How is that should be
Types for queryset and context_object_name should be made less strict to be compatible similar to solution of issue #152
System information
OS: Ubuntu
python version: 3.9.7
django version: 4.0.2
mypy version: 0.931
django-stubs version: 1.9.0
django-stubs-ext version: 0.3.1
The text was updated successfully, but these errors were encountered:
Probably I misunderstand something, but it looks like unsafe code. SingleObjectMixin.queryset is a queryset to get_object from, it should be QuerySet[Account] (if it is "view listing transactions for account"). MultipleObjectMixin.queryset is queryset you operate on (e.g. render in ListView) - it should be QuerySet[Transaction]. These two bases are really incompatible.
Bug report
What's wrong
I have view class in django-hordak defined as:
Which gives the following mypy errors:
How is that should be
Types for
queryset
andcontext_object_name
should be made less strict to be compatible similar to solution of issue #152System information
python
version: 3.9.7django
version: 4.0.2mypy
version: 0.931django-stubs
version: 1.9.0django-stubs-ext
version: 0.3.1The text was updated successfully, but these errors were encountered: