筛选

从女道男

girl=models.Girl.objects.get(id=1)

girl.b.filter().count()

从男到女

boy=models.Boy.objects.get(id=1)\

boy.girl_set.all()


girl=models.Girl.objects.all().values("id","username","b__username")#b__username查询的是boy表跟girl有关系的数据
    print("G`1",girl)


boy=models.Boy.objects.all().values("id","username","girl__username")#girl__username查询的是boy表跟girl有关系的数据
    print("G`1",boy)#反表操作