python - Django Orm Related Table Condition -
I have a table foo that is related to table bar, how can I filter it in Django Orm?
Raw query:
select from foo as a *, bar as b where a.bar_id = b.id and b.is_deleted = 0
Django Orm:
Foo.objects.filter (& lt; bar_is_deleted & gt; = 0)
Foo.objects.filter (bar__is_deleted = False)
Comments
Post a Comment