Created
December 2, 2020 12:46
-
-
Save pretzelhands/f7ce276bf5d59f5ac5ca9e25a37ee0d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Return next 60 days by default | |
start = datetime.combine(date.today(), time(0, 0)) | |
end = start + timedelta(days=60) | |
logging.error('//////////////////////////////////////// IT IS WHAT IT IS: {} {}'.format(start, end)) | |
if (start := self.request.query_params.get('start')) and (end := self.request.query_params.get('end')): | |
start = datetime.combine(datetime.strptime(start, '%Y-%m-%d').date(), time(0, 0)) | |
end = datetime.combine(datetime.strptime(end, '%Y-%m-%d').date(), time(23, 59)) | |
logging.error('||||||||||||||||||||||||||||||||||||||||||||| WHATS GOING ON HERE: {} {}'.format(start, end)) | |
# Endpoints | |
# | |
# /shows/1/schedules/1/timeslots/ | |
# | |
# Returns timeslots of the given show and schedule | |
# | |
if show_pk and schedule_pk: | |
logging.error('############################################# {} {}'.format(start, end)) | |
return TimeSlot.objects.filter(show=show_pk, schedule=schedule_pk, start__gte=start, end__lte=end).order_by('start') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ERROR:root://////////////////////////////////////// IT IS WHAT IT IS: 2020-12-02 00:00:00 2021-01-31 00:00:00 | |
ERROR:root:############################################# None 2021-01-31 00:00:00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment