|
1480 | 1480 | MyModel.objects.get(xyz__isnull=False) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, others [misc]
|
1481 | 1481 | MyModel.objects.exclude(xyz__isnull=False) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, others [misc]
|
1482 | 1482 | other = Other()
|
1483 |
| - other.mymodel_set.filter(xyz__isnull=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, mymodel, mymodel_id, other, other_id [misc] |
1484 |
| - other.mymodel_set.get(xyz__isnull=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, mymodel, mymodel_id, other, other_id [misc] |
1485 |
| - other.mymodel_set.exclude(xyz__isnull=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, mymodel, mymodel_id, other, other_id [misc] |
| 1483 | + other.mymodel_set.filter(xyz__isnull=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, others [misc] |
| 1484 | + other.mymodel_set.get(xyz__isnull=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, others [misc] |
| 1485 | + other.mymodel_set.exclude(xyz__isnull=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, others [misc] |
1486 | 1486 | MyModel.others.through.objects.filter(xyz__isnull=False) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, mymodel, mymodel_id, other, other_id [misc]
|
1487 | 1487 | MyModel.others.through.objects.get(xyz__isnull=False) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, mymodel, mymodel_id, other, other_id [misc]
|
1488 | 1488 | MyModel.others.through.objects.exclude(xyz__isnull=False) # E: Cannot resolve keyword 'xyz' into field. Choices are: id, mymodel, mymodel_id, other, other_id [misc]
|
|
1498 | 1498 |
|
1499 | 1499 | class MyModel(models.Model):
|
1500 | 1500 | others = models.ManyToManyField(Other)
|
| 1501 | +
|
| 1502 | +- case: test_reverse_m2m_relation_checks_other_model |
| 1503 | + main: | |
| 1504 | + from myapp.models import Author |
| 1505 | + Author().book_set.filter(featured=True) |
| 1506 | + Author().book_set.filter(xyz=True) # E: Cannot resolve keyword 'xyz' into field. Choices are: authors, featured, id [misc] |
| 1507 | + installed_apps: |
| 1508 | + - myapp |
| 1509 | + files: |
| 1510 | + - path: myapp/__init__.py |
| 1511 | + - path: myapp/models.py |
| 1512 | + content: | |
| 1513 | + from django.db import models |
| 1514 | +
|
| 1515 | + class Author(models.Model): |
| 1516 | + ... |
| 1517 | +
|
| 1518 | + class Book(models.Model): |
| 1519 | + featured = models.BooleanField(default=False) |
| 1520 | + authors = models.ManyToManyField(Author) |
0 commit comments