class Apple( models.Model): origin_level = models.ForeignKey(AppleLevel, related_name='orgin_level_appleset') new_level = models.ForeignKey(AppleLevel, related_name='new_level_appleset')
1. 反向查询: AppleLevel 是 Apple的父级 , 父级查找子级
AppleLevel.object.get(id=12).origin_level_appleset.objects.all()
2. 反向查询: AppleLevel 是 Apple的父级 , 父级查找子级
AppleLevel.object.get(id=12).new_level_appleset.objects.all()