📅  最后修改于: 2022-03-11 14:47:03.951000             🧑  作者: Mango
users_in_1zone = User.objects.filter(zones__id=)
# same thing but using in
users_in_1zone = User.objects.filter(zones__in=[])
# filtering on a few zones, by id
users_in_zones = User.objects.filter(zones__in=[, , ])
# and by zone object (object gets converted to pk under the covers)
users_in_zones = User.objects.filter(zones__in=[zone1, zone2, zone3])