#34079: Excessive parentheses when generating a query
-----------------------------------------+------------------------
Reporter: Lelikov | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 4.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
ORM:
{{{
Model.objects.filter(field=Func(F("user__notification_email_types"),
function="ANY")
}}}
SQL:
{{{
..."app_model"."filed" = (ANY("app_user"."notification_email_types")))
}}}
Error:
{{{
syntax error at or near "ANY"
}}}
The reason for the code change in version 4.0. The excessive parentheses
around the function ANY
django/db/models/lookups.py
{{{
if sql and sql[0] != "(":
sql = "(%s)" % sql
}}}
In version 3.2 everything worked correctly
--
Ticket URL: <https://code.djangoproject.com/ticket/34079>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070183bd89e6bc-3999abab-96dd-497f-91a9-1a1f2c661be8-000000%40eu-central-1.amazonses.com.