How to get a django QuerySet of all ForeignKeys of all objects in a Queryset

前端 未结 3 1645
温柔的废话
温柔的废话 2021-02-03 12:27

I have a model (or actually 2 models, but the other is not that relevant)

class Foo(models.Model):
    ...
    bar = models.ForeignKey(Bar,
        ...
    )
         


        
3条回答
提交回复
热议问题