#23460: Allow a literal `%s` to be passed through extra select
-------------------------------------+-------------------------------------
     Reporter:  mattrobenolt         |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  1.7
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:
     Keywords:  queryset             |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by mattrobenolt:

Old description:

> Right now, if you try and do something like this:
>
> {{{
> Foo.objects.extra(select={'foo': "'%%s"'})
> }}}
>
> or
>
> {{{
> Foo.objects.extra(select={'foo': '"%s"'})
>
> See: https://github.com/django/django/pull/3209 for patch.
> }}}
>
> it blows up because it tries to convert the %s into a parameter
>
> It's expected to allow %%s as an escape sequence.

New description:

 Right now, if you try and do something like this:

 {{{
 Foo.objects.extra(select={'foo': "'%%s"'})
 }}}

 or

 {{{
 Foo.objects.extra(select={'foo': '"%s"'})
 }}}

 it blows up because it tries to convert the %s into a parameter

 It's expected to allow %%s as an escape sequence.

 See: https://github.com/django/django/pull/3209 for patch.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/23460#comment:2>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.fd67090fe92b8d0301e805c4939175c4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to