You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a Postgres Ltree field and want to use one of its operators (e.g. <@) in a model query, but retain the rest of the QuerySet filtering, sorting, etc in the code I'm writing.
It seems like operators are hardcoded? I'm struggling to find out how to include some raw SQL in a QuerySet as well, since TypeError: expected Q objects as args.
Is there any way to get a Postgres Ltree operator into a QuerySet as part of the filter? Thanks!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using a Postgres Ltree field and want to use one of its operators (e.g.
<@
) in a model query, but retain the rest of theQuerySet
filtering, sorting, etc in the code I'm writing.It seems like operators are hardcoded? I'm struggling to find out how to include some raw SQL in a
QuerySet
as well, sinceTypeError: expected Q objects as args
.Is there any way to get a Postgres Ltree operator into a
QuerySet
as part of the filter? Thanks!Beta Was this translation helpful? Give feedback.
All reactions