Opened 10 years ago
Last modified 10 years ago
#23460 closed Bug
Allow a literal `%s` to be passed through extra select — at Version 3
Reported by: | Matt Robenolt | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.7 |
Severity: | Normal | Keywords: | queryset |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Right now, if you try and do something like this:
Foo.objects.extra(select={'foo': "'%%s"'})
or
Foo.objects.extra(select={'foo': '"%s"'})
Ultimately add_extra
raises a StopIteration
while iterating over param_iter
since there aren't actually any arguments to format.
It's expected to allow %%s as an escape sequence.
See: https://github.com/django/django/pull/3209 for patch.
Change History (3)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
comment:2 by , 10 years ago
Description: | modified (diff) |
---|
comment:3 by , 10 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.