-
-
Notifications
You must be signed in to change notification settings - Fork 494
Closed
Description
get_object_or_404
is returning type Model
when I would expect it to return type Team
.
Here's the example:
from django.shortcuts import get_object_or_404
from django.db import models
class Team(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")
mypy = "^0.670
mypy_extensions = "^0.4.1"
django-stubs = "^0.3.0"
Metadata
Metadata
Assignees
Labels
No labels