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
The fulle error is Incompatible types in assignment (expression has type "Equipment_ManyRelatedManager[EquipmentEstablishmentMembership]", variable has type "ManyRelatedManager[Equipment, Model]")
When I looked at the source code, it seems that Equipment_ManyRelatedManager is generated by django stubs in certain cases. Is that expected that I receive this type in the calling code?
Thanks!
The text was updated successfully, but these errors were encountered:
As long as your Establishment class is a subclass of models.Model, could perhaps a solution here be to change the through= to have a full lazy reference? e.g. "<app_label>. EquipmentEstablishmentMembership" Ref: #1802 (comment)
And then remove the explicit type annotation for the field as mypy should be able to infer the type itself.
Additionally, 5.0.0 included an update to ManyRelatedManager to have 2 type parameters in #2026. If the type hinting is necessary/wanted for equipments_manager you probably want to change:
Hi, when upgrading to version 5.0.0, I get a new error
The fulle error is
Incompatible types in assignment (expression has type "Equipment_ManyRelatedManager[EquipmentEstablishmentMembership]", variable has type "ManyRelatedManager[Equipment, Model]")
When I looked at the source code, it seems that
Equipment_ManyRelatedManager
is generated by django stubs in certain cases. Is that expected that I receive this type in the calling code?Thanks!
The text was updated successfully, but these errors were encountered: