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
timezone.localtime(timezone.now()).date()
gets you the correct date.
To get events occurring today(start
today):
from django.utils import timezone
class EventManager(models.Manager):
def bookings_today(self, location_id):
t = timezone.localtime(timezone.now())
bookings = self.filter(location=location_id, start__year = t.year,
start__month = t.month, start__day = t.day, )