📅  最后修改于: 2022-03-11 14:47:10.701000             🧑  作者: Mango
#Model
class Kid(models.Model):
name = models.CharField(max_length=200)
class Toy(models.Model):
name = models.CharField(max_length=200)
owner = models.ForeignKey(Kid)
#view
Kid.objects.distinct().filter(toy__name__icontains='star')