[Django] #32474: JSONField and register_default_jsonb all json column return as str

26 views
Skip to first unread message

Django

unread,
Feb 22, 2021, 4:28:19 AM2/22/21
to django-...@googlegroups.com
#32474: JSONField and register_default_jsonb all json column return as str
------------------------------------------------+------------------------
Reporter: koshak01 | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.postgres | Version: 3.1
Severity: Normal | Keywords: jsonb
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
when i make select all json field as string

# Register dummy loads() to avoid a round trip from psycopg2's decode
# to json.dumps() to json.loads(), when using a custom decoder in
# JSONField.
psycopg2.extras.register_default_jsonb(conn_or_curs=connection,
loads=lambda x: x)

/Users/koshak01/Virtualenvs/virtual3.9/lib/python3.9/site-
packages/django/db/backends/postgresql/base.py:206


i make raw select request w/o ORM

--
Ticket URL: <https://code.djangoproject.com/ticket/32474>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 22, 2021, 4:37:40 AM2/22/21
to django-...@googlegroups.com
#32474: JSONField and register_default_jsonb all json column return as str
-------------------------------------+-------------------------------------
Reporter: koshak01 | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution: duplicate

Keywords: jsonb | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* owner: (none) => nobody
* resolution: => duplicate
* status: new => closed
* component: contrib.postgres => Database layer (models, ORM)


Comment:

Duplicate of #31991.

--
Ticket URL: <https://code.djangoproject.com/ticket/32474#comment:1>

Reply all
Reply to author
Forward
0 new messages