[Django] #33076: Djang3.0 generate invalid query

17 views
Skip to first unread message

Django

unread,
Aug 31, 2021, 2:08:37 PM8/31/21
to django-...@googlegroups.com
#33076: Djang3.0 generate invalid query
-------------------------------------+-------------------------------------
Reporter: Awais | Owner: nobody
Qureshi |
Type: Bug | Status: new
Component: Database | Version: 3.0
layer (models, ORM) | Keywords: F expression, Q
Severity: Normal | expression, ORM
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I am trying to run tests again django3.0 and I am getting sql error in a
generated query.
I am sharing part of query which is causing error
WHERE (U5."organization_id" IN
"course_metadata_course_authoring_organizations"."organization_id" this
line triggers error
Result: no such table:
course_metadata_course_authoring_organizations.organization_id

Code is some thing like this
editors__user__groups__organization_extension__organization__in=F('authoring_organizations')

authoring_organizations is manytomanyfield.

I did't find any thing in release notes.


Thanks
Awais

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

Django

unread,
Aug 31, 2021, 2:09:30 PM8/31/21
to django-...@googlegroups.com
#33076: Djang3.0 generate invalid query
-------------------------------------+-------------------------------------
Reporter: Awais Qureshi | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: F expression, Q | Triage Stage:
expression, ORM | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Awais Qureshi:

Old description:

> I am trying to run tests again django3.0 and I am getting sql error in a
> generated query.
> I am sharing part of query which is causing error
> WHERE (U5."organization_id" IN
> "course_metadata_course_authoring_organizations"."organization_id" this
> line triggers error
> Result: no such table:
> course_metadata_course_authoring_organizations.organization_id
>
> Code is some thing like this
> editors__user__groups__organization_extension__organization__in=F('authoring_organizations')
>
> authoring_organizations is manytomanyfield.
>
> I did't find any thing in release notes.
>

> Thanks
> Awais

New description:

I am trying to run tests again django3.0 and I am getting sql error in a
generated query.
I am sharing part of query which is causing error
WHERE (U5."organization_id" IN
"course_metadata_course_authoring_organizations"."organization_id" this
line triggers error
Result: no such table:
course_metadata_course_authoring_organizations.organization_id

Code is some thing like this
`editors__user__groups__organization_extension__organization__in=F('authoring_organizations')`

authoring_organizations is manytomanyfield.

I did't find any thing in release notes.


Thanks
Awais

--

--
Ticket URL: <https://code.djangoproject.com/ticket/33076#comment:1>

Django

unread,
Aug 31, 2021, 2:12:46 PM8/31/21
to django-...@googlegroups.com
#33076: SyntaxError when using __in lookup with F() expression.

-------------------------------------+-------------------------------------
Reporter: Awais Qureshi | Owner: nobody
Type: Bug | Status: closed

Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution: duplicate

Keywords: F expression, Q | Triage Stage:
expression, ORM | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #31135, see also #32414.

--
Ticket URL: <https://code.djangoproject.com/ticket/33076#comment:2>

Django

unread,
Aug 31, 2021, 2:42:25 PM8/31/21
to django-...@googlegroups.com
#33076: SyntaxError when using __in lookup with F() expression.
-------------------------------------+-------------------------------------
Reporter: Awais Qureshi | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: F expression, Q | Triage Stage:
expression, ORM | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Awais Qureshi):

I forgot to mention this code is working fine in django2.2.

--
Ticket URL: <https://code.djangoproject.com/ticket/33076#comment:3>

Reply all
Reply to author
Forward
0 new messages