Changes between Initial Version and Version 1 of Ticket #32203, comment 3


Ignore:
Timestamp:
Nov 17, 2020, 10:04:54 PM (4 years ago)
Author:
Sage Abdullah

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 is the better option.
     1This 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.
    22
    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.
     3I'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).
Back to Top