1👍
You can use __in
lookup with distinct()
so:
booking_list = Booking.objects.filter(rooms__in=[i for i in numbers]).distinct("rooms")
Source:stackexchange.com
1👍
You can use __in
lookup with distinct()
so:
booking_list = Booking.objects.filter(rooms__in=[i for i in numbers]).distinct("rooms")