Django ORM. Joining subquery

后端 未结 3 539
野趣味
野趣味 2021-01-05 01:38

I have a table which contains list of some web sites and a table with statistics of them.

class Site(models.Model):
    domain_name = models.CharField(
              


        
3条回答
  •  佛祖请我去吃肉
    2021-01-05 02:08

    Look at it this way: you want to see statistics with accompanying site data for certain date, which translates to:

    Stats.objects.filter(date=my_date).select_related('site')
    

提交回复
热议问题