-
-
Notifications
You must be signed in to change notification settings - Fork 36
Fix to work in parallel with django.contrib.postgres.JSONField #5
Comments
What is the status of this bug? When can we expect a solution? |
This is not being worked on. Please look into it yourself if it is
important to you.
On Fri, 31 May 2019 at 23:39, Jake Urban ***@***.***> wrote:
What is the status of this bug? When can we expect a solution?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5?email_source=notifications&email_token=AAGRMCNCWEZJRGJUASNH3QLPYGLIFA5CNFSM4G67AKUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWWN6AQ#issuecomment-497868546>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGRMCNOBWV6MFDB4CMUGG3PYGLIFANCNFSM4G67AKUA>
.
--
Adam
|
I believe it's because of this line https://github.com/adamchainz/django-jsonfield/blob/master/jsonfield/fields.py#L198 The registration is shared on the same database connection (see https://github.com/psycopg/psycopg2/blob/master/lib/_json.py#L93), so it'll interfere with A fix I'd propose is to use Might worth a look if @jakeatallyo (or anyone else) is looking for a quick fix. |
@laymonage thank you for that comment. If you have some spare time it would be great if you could create a PR for that fix and test it alongside current and future Django JSONFields. You are the world expert now :) |
Fix #5. Instead of registering a no-op `loads()` to avoid psycopg2's automatic decoding, we cast the value into `text`. As [the docs](http://initd.org/psycopg/docs/extras.html#json-adaptation) say, it is an efficient operation that doesn’t involve a copy.
See https://bitbucket.org/schinckel/django-jsonfield/issues/57/cannot-use-in-the-same-project-as-djangos
This issue looks complicated, there's a whole library by @kbussell to introduce that compatibility, https://github.com/kbussell/django-jsonfield-compat . The technique it uses should probably be merged in here!
The text was updated successfully, but these errors were encountered: