django
django copied to clipboard
Fixed #33918 #25705 __str__ method in Query object wraps strings in quotation marks
When executing str
on django.db.models.sql.query.Query
objects, string parameters will be wrapped in single quotation marks.
For example:
str(Article.objects.filter(headline="", id=1).values("id").query)
returns
SELECT "backends_article"."id" FROM "backends_article" WHERE ("backends_article"."headline" = '' AND "backends_article"."id" = 1)
@johniak Thanks for this patch :+1: , however it's more complicated, see e.g. #12156.
@felixxm thanks for your comment, I modified PR. I added support for ranges, and tests pass through all pipelines