El martes, 17 de abril de 2018, 9:11:23 (UTC-3), Josh Smeaton escribió:
>
> Have you looked into using Cast for this particular query to see if it
> passes?
>
> https://docs.djangoproject.com/en/2.0/ref/models/database-functions/#cast
>
> Cast(RawSQL('%s', ['value']), CharField(max_length=10) ?
Have you looked into using Cast for this particular query to see if it
passes?
https://docs.djangoproject.com/en/2.0/ref/models/database-functions/#cast
Cast(RawSQL('%s', ['value']), CharField(max_length=10) ?
If that worked, then perhaps you could find a clever way to wrap problem
expressions
Hi Shai,
Thank for the tip
El martes, 17 de abril de 2018, 3:01:30 (UTC-3), Shai Berger escribió:
>
> Hi Maximiliano,
>
> On Sat, 14 Apr 2018 19:25:48 -0700 (PDT)
> Maximiliano Robaina > wrote:
>
> > Hi,
> >
> > Testing expressions test app, the query generated into
> > BasicExpressionsTes
Hi Maximiliano,
On Sat, 14 Apr 2018 19:25:48 -0700 (PDT)
Maximiliano Robaina wrote:
> Hi,
>
> Testing expressions test app, the query generated into
> BasicExpressionsTests.test_annotate_values_filter method:
>
> companies = Company.objects.annotate(
> foo=RawSQL('%s', ['value']),
> ).filter(
Hi Josh,
Thanks for response.
El domingo, 15 de abril de 2018, 20:35:54 (UTC-3), Josh Smeaton escribió:
>
> It looks correct to me. RawSQL is defining a parameter to be included in
> the query. The RawSQL expression itself is used in the select and on the
> left hand side of the WHERE clause, s
It looks correct to me. RawSQL is defining a parameter to be included in
the query. The RawSQL expression itself is used in the select and on the
left hand side of the WHERE clause, so the parameter needs to be included
there. The right hand side of the WHERE clause is a regular string (which
j
Hi,
Testing expressions test app, the query generated into
BasicExpressionsTests.test_annotate_values_filter method:
companies = Company.objects.annotate(
foo=RawSQL('%s', ['value']),
).filter(foo='value').order_by('name')
Generate:
'SELECT "EXPRESSIONS_COMPANY"."ID", "EXPRESSIONS_COMPANY"."N