How to avoid n+1 select in django?

后端 未结 3 641
日久生厌
日久生厌 2021-02-05 18:01

I have a very simple datamodel with a one to many relationship between video and comments

class Video(models.Model):
    url = models.URLField(unique=True)
    .         


        
3条回答
  •  野的像风
    2021-02-05 18:57

    See if select related works the way you expect it to, it was made just for that.

提交回复
热议问题