Opened 8 months ago
Closed 7 months ago
#35436 closed Bug (fixed)
HStoreField shows nonASCII characters as unicode-escaped in the admin
Reported by: | Antonis Christofides | Owned by: | Jae Hyuck Sa |
---|---|---|---|
Component: | contrib.postgres | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
I have an HStoreField()
that has the following contents:
aira=# select title from aira_maplayer where id=22; title ------------------------------------------------------ "el"=>"Αρδευτικό δίκτυο", "en"=>"Irrigation network" (1 row)
In the Django admin, it shows like this:
{"el": "\u0391\u03c1\u03b4\u03b5\u03c5\u03c4\u03b9\u03ba\u03cc \u03b4\u03af\u03ba\u03c4\u03c5\u03bf", "en": "Irrigation network"}
Change History (9)
comment:1 by , 8 months ago
Easy pickings: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 7 months ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:4 by , 7 months ago
Has patch: | set |
---|
follow-up: 7 comment:5 by , 7 months ago
The patch LGTM and is aligned on how we tested JSONField
in de81676b51e4dad510ef387c3ae625f9091fe57f. Thank you for taking the time to submit a patch Jae Hyuck.
comment:7 by , 7 months ago
Replying to Simon Charette:
The patch LGTM and is aligned on how we tested
JSONField
in de81676b51e4dad510ef387c3ae625f9091fe57f. Thank you for taking the time to submit a patch Jae Hyuck.
Thank you :) I'm still lacking a lot, but I'll learn and contribute a lot to Django.
comment:8 by , 7 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
The reason for it is that
contrib.postgres.forms.HStoreField.prepare_value
doesn't passensure_ascii=False
tojson.dumps
.When we fixed it for
JSONField
in #32080 we didn't do the same forHStoreField
unfortunately.