I have a model
class Booked(models.Model):
start_date_time = models.DateTimeField()
end_date_time = models.DateTimeField()
resource = models.ForeignKey(Resouce)
How do I check if a particular datetime range doesn't fall between the start or end datetimes of any of the booked objects?
I want to check if I can book a resource with say book_start_date
and book_end_date
without it being already booked during that range