The output field of the KeyTransform is a CharField
The ->> operator always evaluates to a textual representation of the JSON value, so the key transform results in a char-like value
Two tests fail and have been commented out: comparisons like .filter(field__at_key={ "some": [ "complex", { "json": construct" } ] }) aren't really possible for JSON fields; that would compare the textual JSON serialization of the value stored in Postgres against the textual JSON serialization produced by Python's json.dumps. Those are definitely not guaranteed to match, especially with regard to dictionary key order. The test cases are so trivial that they pass by chance, but might lead people to believe they can do things with JSON fields that they can't really do.
The output field of the
KeyTransform
is aCharField
The
->>
operator always evaluates to a textual representation of the JSON value, so the key transform results in a char-like valueTwo tests fail and have been commented out: comparisons like
.filter(field__at_key={ "some": [ "complex", { "json": construct" } ] })
aren't really possible for JSON fields; that would compare the textual JSON serialization of the value stored in Postgres against the textual JSON serialization produced by Python'sjson.dumps
. Those are definitely not guaranteed to match, especially with regard to dictionary key order. The test cases are so trivial that they pass by chance, but might lead people to believe they can do things with JSON fields that they can't really do.