Annotating a Django queryset with a left outer join?

前端 未结 10 755
予麋鹿
予麋鹿 2020-12-14 01:06

Say I have a model:

class Foo(models.Model):
    ...

and another model that basically gives per-user information about Foo:

10条回答
  •  青春惊慌失措
    2020-12-14 02:00

    As for outerjoins: Once you have a queryset qs from foo that includes a reference to columns from userfoo, you can promote the inner join to an outer join with qs.query.promote_joins(["userfoo"])

提交回复
热议问题