I\'m struggling to logically represent the following in a Django filter. I have an \'event\' model, and a location model, which can be represented as:
class
You need to use a range there like this:
class EventManager(models.Manager): def bookings_today(self, location_id): from datetime import datetime now = datetime.now() bookings = self.filter(location=location_id, start__lte=now, end__gte=now) return bookings