Opened 9 years ago
Last modified 9 years ago
#28047 closed Bug
Regression in query set against 1.10 — at Version 1
| Reported by: | Thierry Bastian | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.11 |
| Severity: | Release blocker | Keywords: | regression |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I have this (simplified)
from django.db import models class Foo(models.Model): class Meta: app_label = 'inventory' pass class Bar(models.Model): class Meta: app_label = 'inventory' foo = models.OneToOneField(Foo, primary_key=True, on_delete=models.CASCADE)
Of course you need an app named inventory. But just use this and try to create a query set like this:
Bar.objects.filter(foo__in=Foo.objects.all())
Obviously I had different criteria.
Creating that query set says:
"django.core.exceptions.FieldError: Cannot resolve keyword 'foo' into field. Choices are: bar, id"
That was working just fine in Django 1.10
Note:
See TracTickets
for help on using tickets.