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
None of the answers I saw is timezone aware.
Why don't you just do this instead:
from django.utils import timezone
class EventManager(models.Manager):
def bookings_today(self, location_id):
bookings = self.filter(location=location_id, start__gte=timezone.now().replace(hour=0, minute=0, second=0), end__lte=timezone.now().replace(hour=23, minute=59, second=59))