Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#33076 closed Bug (duplicate)

SyntaxError when using __in lookup with F() expression.

Reported by: Awais Qureshi Owned by: nobody
Component: Database layer (models, ORM) Version: 3.0
Severity: Normal Keywords: F expression, Q expression, ORM
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Awais Qureshi)

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

authoring_organizations is manytomanyfield.

I did't find any thing in release notes.


Change History (3)

comment:1 Changed 2 years ago by Awais Qureshi

Description: modified (diff)

comment:2 Changed 2 years ago by Mariusz Felisiak

Resolution: duplicate
Status: newclosed
Summary: Djang3.0 generate invalid querySyntaxError when using __in lookup with F() expression.

Duplicate of #31135, see also #32414.

comment:3 Changed 2 years ago by Awais Qureshi

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

Note: See TracTickets for help on using tickets.
Back to Top