Changes between Version 3 and Version 4 of Ticket #32135, comment 2


Ignore:
Timestamp:
Oct 23, 2020, 3:16:34 PM (4 years ago)
Author:
Michael Anuzis

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32135, comment 2

    v3 v4  
    77Context: Not an expert on `json` or `jsonb` and didn't know the difference existed until I discovered a bug where `jsonb` loses the sequence of data deliberately stored via OrderedDict.  Not the only person with this need looking for a solution online, the stackoverflow workaround suggested earlier appeared to solve the issue cleanly for ~50-80 developers in a similar spot.
    88
    9 In my case, I don't need to query/filter against any subfields within the JSON via Django's ORM and one potential workaround would be using a TextField and manually processing every interaction with json.loads() & json.dumps() since this workaround is only needed in 1 place of the app, and while preserving sequence is critically important it's a low frequency interaction and performance won't suffer much. It'd be nice if django could support preserving the sequence of objects stored via JSON, but if version3.1 going forward strictly forbid a workaround that worked up to 3.0 it would help to know so I can put in the work now switching this instance to a TextField and moving on to 3.1.  Appreciate any guidance you can provide.
     9In my case, I don't need to query/filter against any subfields within the JSON via Django's ORM and one potential workaround would be using a TextField and manually processing every interaction with json.loads() & json.dumps() since this workaround is only needed in 1 place of the app, and while preserving sequence is critically important it's a low frequency interaction and performance would be fine. It'd be nice if Django could support preserving the sequence of objects stored via JSON, but if version3.1 going forward strictly forbid a workaround that worked up to 3.0 it would help to know so I can put in the work now switching this instance to a TextField and moving on to 3.1.  Appreciate any guidance you can provide.
Back to Top