Changes between Initial Version and Version 1 of Ticket #32203, comment 3
- Timestamp:
- Nov 17, 2020, 10:04:54 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32203, comment 3
initial v1 1 This is because SQLite's `JSON_EXTRACT` returns deserialized values. A simple solution is just to add `TypeError` [https://github.com/django/django/blob/master/django/db/models/fields/json.py#L80 here], which will also partially "solve" problems with people who use the JSON data type on PostgreSQL. Another option is to wrap the value in `JSON_QUOTE`... which I think isthe better option.1 This is because SQLite's `JSON_EXTRACT` returns deserialized values. A simple solution is just to add `TypeError` [https://github.com/django/django/blob/master/django/db/models/fields/json.py#L80 here], which will also partially "solve" problems with people who use the JSON data type on PostgreSQL. Another option is to wrap the value in `JSON_QUOTE`... which I think ''might be'' the better option. 2 2 3 I'm guessing there's also a bug in querying `__key` on `{"key": "\"value\""}`, which will return `value` rather than `"value"`. I ''think'' wrapping the value in `JSON_QUOTE` should fix this as well. 3 I'm guessing there's also a bug in querying `__key` on `{"key": "\"value\""}`, which will return `value` rather than `"value"`. I ''think'' wrapping the value in `JSON_QUOTE` should fix this as well... but it would break ordering (and maybe some other stuff).