[Django] #35398: If the JSONField contains numbers key, the hash_key query becomes invalid

8 views
Skip to first unread message

Django

unread,
Apr 23, 2024, 3:11:14 AMApr 23
to django-...@googlegroups.com
#35398: If the JSONField contains numbers key, the hash_key query becomes invalid
-------------------------------------+-------------------------------------
Reporter: | Owner: nobody
hanjiangxue20 |
Type: Bug | Status: new
Component: Database | Version: 3.0
layer (models, ORM) |
Severity: Release | Keywords:
blocker |
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The JSONField defined in the django model contain numbers, such as {"123":
"abc"}, and querying XX.objects.filter (has_key_123) is invalid! get
nothing.
--
Ticket URL: <https://code.djangoproject.com/ticket/35398>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 23, 2024, 3:13:54 AMApr 23
to django-...@googlegroups.com
#35398: If the JSONField contains numbers key, the hash_key query becomes invalid
-------------------------------------+-------------------------------------
Reporter: hanjiangxue20 | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by hanjiangxue20:

Old description:

> The JSONField defined in the django model contain numbers, such as
> {"123": "abc"}, and querying XX.objects.filter (has_key_123) is invalid!
> get nothing.

New description:

The JSONField defined in the django model contain numbers, such as fields:
tags value is {"123": "abc"}, and querying XX.objects.filter
(tags__has_key='123') is invalid! get nothing.

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

Django

unread,
Apr 23, 2024, 3:18:18 AMApr 23
to django-...@googlegroups.com
#35398: If the JSONField contains numbers key, the hash_key query becomes invalid
-------------------------------------+-------------------------------------
Reporter: hanjiangxue20 | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by willzhao):

can you elaborate on this issue and provide a minimal reproducible case?
--
Ticket URL: <https://code.djangoproject.com/ticket/35398#comment:2>

Django

unread,
Apr 23, 2024, 5:16:48 AMApr 23
to django-...@googlegroups.com
#35398: If the JSONField contains numbers key, the hash_key query becomes invalid
-------------------------------------+-------------------------------------
Reporter: hanjiangxue20 | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* resolution: => duplicate
* severity: Release blocker => Normal
* status: new => closed

Comment:

Duplicate of #33552 and fixed as of 4.1 (note that 3.0 is no longer
supported)
--
Ticket URL: <https://code.djangoproject.com/ticket/35398#comment:3>
Reply all
Reply to author
Forward
0 new messages