Django 1.8 QuerySet: .extra syntax in Q object

331 Views Asked by At

I have several complex SQL Statements which are used to filter a django Queryset using .extra().

qs.extra(where=["my_jsonb_field-->'my_key'::text LIKE %s"], params=["myValue"])

Since these are queries on json fields, there is no possibility to get rid of these statements (at least not with django 1.8). Is it possible to use Q() objects with the .extra() syntax?

# Q has no .extra
Q().extra(...)

# Q has no .raw
Q().raw(...) 
0

There are 0 best solutions below