#28047: Regression in query set against 1.10
-------------------------------------+-------------------------------------
     Reporter:  Thierry Bastian      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.11
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  regression           |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Ingo Klöcker:

Old description:

> 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

New description:

 I have this (simplified)

 {{{#!python
 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:

 {{{#!python
 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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28047#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.aa5b34272e071f53d334a521b6a8a75d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to