0

Doubt in Django

How does the filter query set work? Like, Room.objects.filter(R_category=room_category,available=True) Room - model name, R_category = charfield in Room model, available = booleanfield in Room model

29th Apr 2021, 7:42 AM
Vinitha
Vinitha - avatar
1 ответ
+ 1
The query will filter all objects in the 'Room' model, whose 'R_category' field is equal to 'room_category' and 'available' field is set to True. See this: https://docs.djangoproject.com/en/3.2/topics/db/queries/#retrieving-specific-objects-with-filters
29th Apr 2021, 9:02 AM
XXX
XXX - avatar