What is your model, is 'date' a DateField or a CharField?
On Thu, Aug 22, 2019, 12:47 PM wd QuerySet.query is not a plain string, it's an Query object, you can check
> the source code
>
> def __str__(self):
>> """
>> Return the query as a string of SQL with the parameter values
>> su
QuerySet.query is not a plain string, it's an Query object, you can check
the source code
def __str__(self):
> """
> Return the query as a string of SQL with the parameter values
> substituted in (use sql_with_params() to see the unsubstituted string).
>
> Parameter values won't ne
What makes sense to me is the query builder (ORM) in Django
"escapes"/quotes the values at the very last moment: whenever the query is
to be executed in a database. Different databases can have different escape
characters. When you print queryset.query it simply isn't at a stage where
the escap
I have a Django queryset that I prepare with
queryset.filter(date__gte=datetime(2011,1,1))
If I then call `str(queryset.query)` I see this in the string:
... WHERE "App_table"."date" >= 2011-1-1
However, this is invalid SQL code as if I run this in Postgresql I get this
error:
... W
4 matches
Mail list logo