diff options
| author | Ben Cail <bcail@crossway.org> | 2022-10-26 09:58:08 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-11-18 05:53:37 +0100 |
| commit | fbde929b19754f19cba1d14e86f4c59f4b0a633c (patch) | |
| tree | 9263b3d9b21a49d21c0e53c808f862101faf4a3f /docs | |
| parent | 81b1c167bf919ddbd5aa0289f9f3761fc62addf3 (diff) | |
Fixed #26056 -- Added QuerySet.values()/values_list() support for ArrayField's __overlap lookup.
Thanks Mads Jensen and kosz85 and the initial patch.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/postgres/fields.txt | 10 | ||||
| -rw-r--r-- | docs/releases/4.2.txt | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/docs/ref/contrib/postgres/fields.txt b/docs/ref/contrib/postgres/fields.txt index 29dbc0db85..31ef0d3982 100644 --- a/docs/ref/contrib/postgres/fields.txt +++ b/docs/ref/contrib/postgres/fields.txt @@ -170,7 +170,7 @@ Returns objects where the data shares any results with the values passed. Uses the SQL operator ``&&``. For example:: >>> Post.objects.create(name='First post', tags=['thoughts', 'django']) - >>> Post.objects.create(name='Second post', tags=['thoughts']) + >>> Post.objects.create(name='Second post', tags=['thoughts', 'tutorial']) >>> Post.objects.create(name='Third post', tags=['tutorial', 'django']) >>> Post.objects.filter(tags__overlap=['thoughts']) @@ -179,6 +179,14 @@ the SQL operator ``&&``. For example:: >>> Post.objects.filter(tags__overlap=['thoughts', 'tutorial']) <QuerySet [<Post: First post>, <Post: Second post>, <Post: Third post>]> + >>> Post.objects.filter(tags__overlap=Post.objects.values_list('tags')) + <QuerySet [<Post: First post>, <Post: Second post>, <Post: Third post>]> + +.. versionchanged:: 4.2 + + Support for ``QuerySet.values()`` and ``values_list()`` as a right-hand + side was added. + .. fieldlookup:: arrayfield.len ``len`` diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt index cbe42cca99..8ab9242f97 100644 --- a/docs/releases/4.2.txt +++ b/docs/releases/4.2.txt @@ -102,6 +102,9 @@ Minor features <django.contrib.postgres.search.TrigramStrictWordDistance>` expressions allow using trigram strict word similarity. +* The :lookup:`arrayfield.overlap` lookup now supports ``QuerySet.values()`` + and ``values_list()`` as a right-hand side. + :mod:`django.contrib.redirects` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
