Changes between Version 5 and Version 6 of Ticket #32135, comment 2
- Timestamp:
- Oct 23, 2020, 3:26:43 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32135, comment 2
v5 v6 1 Update: I see this may be a duplicate (or at least closely related to): https://code.djangoproject.com/ticket/31973 and https://code.djangoproject.com/ticket/321111 This is closely related to: https://code.djangoproject.com/ticket/31973 and https://code.djangoproject.com/ticket/32111 2 2 3 In these existing tickets, the bugs are closed with the assertion "It looks that you use json instead of jsonb datatype in your database, which is not supported."3 These tickets are closed with the assertion "It looks that you use json instead of jsonb datatype in your database, which is not supported." 4 4 5 Is there a reason `json` was permitted via workaround in 3.0 and appears forcefully disabled in 3.1? Is there another option suggested for Django applications that need to preserve the sequence of similar data structures, and where a format like JSON appears to be the cleanest &simplest option for doing so?5 Is there a reason `json` was permitted via workaround in 3.0 and forcefully disabled in 3.1? Is there another option suggested for Django applications that need to preserve the sequence of similar data structures, and where a format like JSON appears to be the simplest option for doing so? 6 6 7 Context: 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.7 Context: Not an expert on `json` or `jsonb` and didn't know the difference existed until I discovered `jsonb` loses the sequence of data deliberately stored via OrderedDict. Others online have had the same need and the stackoverflow workaround solved the issue cleanly for 3.0. 8 8 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 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.9 In this case, I don't need to query/filter 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(). This workaround is only needed in 1 place of the app where preserving sequence is an important. Being a low frequency interaction performance would be fine. Ideally Django could support preserving the sequence of objects stored via JSON, but if 3.1 forward strictly forbids a workaround that worked up to 3.0 perhaps a TextField is the way to go. Appreciate any guidance you can provide.