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
get_object_or_404 is returning type Model when I would expect it to return type Team.
Here's the example:
fromdjango.shortcutsimportget_object_or_404fromdjango.dbimportmodelsclassTeam(models.Model):
name=models.CharField(max_length=255)
is_public=models.BooleanField(default=False)
team: Team=get_object_or_404(Team, pk=5)
# example.py:12:1: error: Incompatible types in assignment (expression has type "Model", variable has type "Team")
get_object_or_404
is returning typeModel
when I would expect it to return typeTeam
.Here's the example:
The text was updated successfully, but these errors were encountered: