Skip to content

Commit

Permalink
Add prints for by day
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Vignos committed Mar 27, 2024
1 parent 52b6cde commit ce571c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/eatery/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ def get_events(self, obj):
day = now.replace(hour=0, minute=0, second=0, microsecond=0) + timedelta(days=day_offset)
day_unix = int(day.timestamp())
day_end_unix = int((day + timedelta(days=1)).timestamp())
print(f"Now: {now}")
print(f"Day: {day}")
print(f"Day Unix: {day_unix}")
print(f"Day End Unix: {day_end_unix}")
events = Event.objects.filter(eatery=obj.id, start__gte=day_unix, start__lt=day_end_unix)
serializer = EventSerializerOptimized(instance=events, many=True)
return serializer.data
Expand Down

0 comments on commit ce571c1

Please sign in to comment.