1 | | Replying to [ticket:28590 Aur Saraf]: |
2 | | > Very low severity, and probably easy pickings: |
3 | | > |
4 | | > In various versions of Django, up to 1.11.5, with sqlite, on Windows: |
5 | | > |
6 | | > {{{ |
7 | | > class M(models.Model): |
8 | | > field = models.CharField(max_length=10) |
9 | | > }}} |
10 | | > |
11 | | > {{{ |
12 | | > >>> from bug import models |
13 | | > >>> print models.M.objects.filter(field='I am a string, look at me').query.__str__() |
14 | | > SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" = I am a string, look at me |
15 | | > >>> models.M.objects.filter(field='I am a string, look at me') |
16 | | > <QuerySet []> |
17 | | > >>> from django.db import connection |
18 | | > >>> print connection.queries[-1]['sql'] |
19 | | > SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" = 'I am a string, look at me' LIMIT 21 |
20 | | > }}} |
21 | | > |
22 | | > {{{ |
23 | | > SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" = I am a string, look at me |
24 | | > SELECT "bug_m"."id", "bug_m"."field" FROM "bug_m" WHERE "bug_m"."field" = 'I am a string, look at me' LIMIT 21 |
25 | | > }}} |
26 | | > |
27 | | > {{{ |
28 | | > WHERE "bug_m"."field" = I am a string, look at me |
29 | | > WHERE "bug_m"."field" = 'I am a string, look at me' |
30 | | > }}} |
31 | | |