如何获取此查询集的值?
我试图获取名称的值,但它只显示对象。
class Brand(models.Model):
name = models.CharField(max_length=255, blank=False)
class SubBrand(models.Model):
name = models.CharField(max_length=255, blank=False)
brand = models.ForeignKey(Brand)
>>> print Brand.objects.filter(subbrand__id='2')
<QuerySet [<Brand: Brand object>]>
答案 0 :(得分:0)
只需使用索引
partition by