class Node(models.Model):
# ...
class Zone(models.Model):
nodes = models.ManyToManyField(Node)
class BusLine(models.Model):
zones = models.ManyToManyField(Zone)
class Service(models.Model):
bus_lines = models.ManyToManyField(BusLine)
如何获得与与ONE服务相关的总线相关的区域相关的所有节点?
答案 0 :(得分:0)
Node.objects.filter(zone__busline__service=my_service)