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
# matches/models.pyclassMatchGroup(models.Model):
members=models.ManyToManyField(
to="users.User",
related_name="match_groups",
)
# users/models.pyclassUser(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
# Details here should not be relevant.
...
When I look up a group by its users like so
user_ids = (1, 2)
group = MatchGroup.objects.get(members=user_ids)
I get the following error from mypy:
Incompatible type for lookup 'members': (got "tuple[int, int]", expected "User | int | None") [misc]
How is that should be
Passing an iterable of integers to the lookup should be ok and not generate errors, because Django can deal with it.
System information
OS:
python version: 3.11
django version: 5.0.6
mypy version: 1.10.0
django-stubs version: 5.0.2
django-stubs-ext version: 5.0.2
The text was updated successfully, but these errors were encountered:
Bug report
What's wrong
I have the following models
When I look up a group by its users like so
I get the following error from mypy:
How is that should be
Passing an iterable of integers to the lookup should be ok and not generate errors, because Django can deal with it.
System information
python
version: 3.11django
version: 5.0.6mypy
version: 1.10.0django-stubs
version: 5.0.2django-stubs-ext
version: 5.0.2The text was updated successfully, but these errors were encountered: