diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-04 11:30:06 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-04 11:31:00 +0100 |
| commit | 49970b5e4d187f39f9fb35c334cd957e3a9e1d61 (patch) | |
| tree | fb8f659dece4ea0a46e23c86053931b78bbb049b /docs | |
| parent | cd7a5bf33d178d568ab873a0d74f1cd597df68e1 (diff) | |
[3.2.x] Refs #32483 -- Doc'd caveat about using JSONField key transforms to booleans with QuerySet.values()/values_list() on SQLite.
Backport of c6b07627fcb5d1c8d2082714ef5adb63bee6cf4c from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/querysets.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 46766da388..ce843cff9b 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -695,6 +695,12 @@ You can also refer to fields on related models with reverse relations through pronounced if you include multiple such fields in your ``values()`` query, in which case all possible combinations will be returned. +.. admonition:: Boolean values for ``JSONField`` on SQLite + + Due to the way the ``JSON_EXTRACT`` SQL function is implemented on SQLite, + ``values()`` will return ``1`` and ``0`` instead of ``True`` and ``False`` + for :class:`~django.db.models.JSONField` key transforms. + ``values_list()`` ~~~~~~~~~~~~~~~~~ @@ -765,6 +771,12 @@ not having any author:: >>> Entry.objects.values_list('authors') <QuerySet [('Noam Chomsky',), ('George Orwell',), (None,)]> +.. admonition:: Boolean values for ``JSONField`` on SQLite + + Due to the way the ``JSON_EXTRACT`` SQL function is implemented on SQLite, + ``values_list()`` will return ``1`` and ``0`` instead of ``True`` and + ``False`` for :class:`~django.db.models.JSONField` key transforms. + ``dates()`` ~~~~~~~~~~~ |
