#27134: JSONField key values are not escaped correctly in queries
-------------------------------+--------------------
     Reporter:  onurmatik      |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.10
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 If a dictionary stored in a JSONField has a key that contains '/', like a
 URI, it is not possible to use that value as a query parameter.

 {{{
 class Token(models.Model):
     status = JSONField()

 >>> Token.objects.create(status={
 ...     '/help/tos': {'remaining': 10},
 ... })

 >>> kwargs = {'status__/help/tos__remaining__gt': 0,}
 >>> Token.objects.filter(**kwargs)
 <QuerySet []>
 }}}

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.ef2e10ac3beb574ef26f389277d467ce%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to