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
classModelAQuerySet(models.QuerySet["ModelA"]):
defcustom_method(self) ->Self:
...
classModelA(models.Model):
objects: ModelAQuerySet=ModelAQuerySet.as_manager() # Pyright: Manager cannot be assigned to queryset
Isn't it for all intensive purposes the closest to the most accurate type? While I understand Django is dynamically creating a new type, not typing this as the queryset will lose us all of the custom methods we added. I think django-types solves this problem for mypy with this plugin, but if you're using Pyright this is probably what you would want to do.
The text was updated successfully, but these errors were encountered:
While I get this isn't technically accurate:
Isn't it for all intensive purposes the closest to the most accurate type? While I understand Django is dynamically creating a new type, not typing this as the queryset will lose us all of the custom methods we added. I think
django-types
solves this problem formypy
with this plugin, but if you're using Pyright this is probably what you would want to do.The text was updated successfully, but these errors were encountered: