for a hotel booking system using django admin, I’d like to filter the rooms available for a given date range, models are as follow
class Room(models.Model):
id = models.AutoField(primary_key=True)
hotel = models.ForeignKey(Hotel, on_delete=models.CASCADE)
class Booking(models.Model):
id = models.AutoField(primary_key=True)
start_date = models.DateField(verbose_name=_("Start date"))
end_date = models.DateField(verbose_name=_("End date"))
room = models.ForeignKey(Room, on_delete=models.CASCADE)
how can I filter the rooms in the admin so I can pick a date range and return only the rooms that have no bookings on the select range?
thanks a lot