Suggestion: a second JSON field that inherits from CharField instead of TextField
The fact that the current JSON field inherits from TextField is a problem in some scenarios.
I would like to define a database index on a JSON field. Although indexes on TEXT are possible (at least in MySQL), they are not supported by Django as TextField does not offer the db_index attribute. Also, they do not make much sense because there is a limit on the size of an index which lies around 700-1000 characters (depending on the database engine). As a result, a TextField only buys you a few hundred characters over a CharField (which has 255). In most scenarios this is not worth the hassle of having to circumvent the fact that Django does not support them.
So, the most reasonable approach for indexing a JSON field would be to have one that works on top of a CharField instead of a TextField.
I have the sense that adding this second type of JSON field would not be much of a big deal, as I guess it does not involve much more than changing the parent class. I could be missing something though.
Would you consider adding a field like this?