Hi Ole,

I'm interested in what you are trying to do with JSONExtract. I have a 
subclass of Func called JSONBExtractPathText that I use with great success 
to extract parts of a JSONB object.

Also, as of Django 3.0, you can filter directly on an expression (that has 
an output_field of BooleanField).

Thus, you could write your first example as:

MyModel.objects.filter(JSONBExtractPathText('field', Value('Foo the bar?'), 
output_field=models.BooleanField())

I think you could possibly do the other stuff using either an 
ExpressionWrapper, or at worst a Case(When()).

(I hang out on #django on IRC if you want to discuss this in a more 
interactive manner).

Matt.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/45fb5bf5-c1d8-44eb-973b-56914264fcc3%40googlegroups.com.

Reply via email to