-
-
Notifications
You must be signed in to change notification settings - Fork 521
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
The following code gives error when it should not
class Cube(Model):
heat = IntegerField(default=0)
class Ice(Model):
cubes = ManyToManyField(Cube, blank=True)
def heat_sum(self) -> int:
return sum(self.cubes.values_list("heat", flat=True)) # <-- ErrorWhat's wrong
mypy gives error
error: Cannot resolve keyword 'heat' into field. Choices are: cube, cube_id, ice, ice_id, id [misc]
How is that should be
No error
System information
- OS: windows
pythonversion: 3.12.1djangoversion: 5.0.3mypyversion: 1.11.0django-stubsversion: 5.0.3django-stubs-extversion: 5.0.3
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working