#26511: Django 1.9 and Postgres 9.4 jsonb string containment inside JSONField
----------------------------------+--------------------------------------
     Reporter:  eoinmurray        |                    Owner:
         Type:  Bug               |                   Status:  closed
    Component:  contrib.postgres  |                  Version:  1.9
     Severity:  Normal            |               Resolution:  worksforme
     Keywords:  postgres, jsonb   |             Triage Stage:  Unreviewed
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+--------------------------------------

Comment (by eoinmurray):

 That will only return objects where the metadata contains the key 'title'
 with the exact value 'moon', it wont match with objects where 'title' is
 'the cow jumped over the moon'...

 I have just tested it there and using your suggested syntax doesnt work
 for me


 {{{
 File.objects.create(name="testfile.txt", owner=some_user,
 metadata={'title': 'the cow jumped over the moon'})

 print File.objects.filter(metadata__contains={'title': 'moon'})

 >>> []
 }}}

 The filter returns no items

--
Ticket URL: <https://code.djangoproject.com/ticket/26511#comment:2>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.776ab3ce6bc3425d98956ee83629bcff%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to