Doubt in Django | Sololearn: Learn to code for FREE!

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

4/29/2021 7:42:51 AM

Vinitha

1 Answer

New Answer

+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