diff options
| author | Julien Phalip <jphalip@gmail.com> | 2012-04-09 00:43:08 +0000 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2012-04-09 00:43:08 +0000 |
| commit | 93d1fdb1304ed5b2e5ea2e0f1e84db7fff5eb7fa (patch) | |
| tree | 908a45af91a033e5b0508ed06ab1f73e52a3dff1 /docs/ref/models | |
| parent | 5c53e30607014163872e89c221b206992a9acfef (diff) | |
Fixed #17877 -- Ensured that extra WHERE clauses get correctly ANDed when they contain OR operations. Thanks to Marek Brzóska for the report, to eleather for the test case and to Adrien Lemaire for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17880 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/models')
| -rw-r--r-- | docs/ref/models/querysets.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index e25bea0e69..b20c6e34e5 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -968,11 +968,11 @@ of the arguments is required, but you should use at least one of them. Example:: - Entry.objects.extra(where=['id IN (3, 4, 5, 20)']) + Entry.objects.extra(where=["foo='a' OR bar = 'a'", "baz = 'a'"]) ...translates (roughly) into the following SQL:: - SELECT * FROM blog_entry WHERE id IN (3, 4, 5, 20); + SELECT * FROM blog_entry WHERE (foo='a' OR bar='a') AND (baz='a') Be careful when using the ``tables`` parameter if you're specifying tables that are already used in the query. When you add extra tables |
