我想要获取所有包含特定多对多字段it的对象。我经历了一大堆,所以我根本没有得到它。我的问题是 name = models.CharField(max_length=30) name = models.CharField(max_length=30)
return self.name
我想要获得所有的披萨对象,其中t
Django文档给出了基于注释的相关字段的示例(即,在QuerySet ()中使用连接)。文档中的一个简化示例是Store.objects.annotate(min_price=Min('books__price')),其中books是Store to Book的ManyToMany字段,价格是Book的字段。为了继续这个例子,我如何生成一个带注释的</