16 lines
486 B
Python
16 lines
486 B
Python
import datetime
|
|
from alion_app.models import Room, Booking
|
|
|
|
def check_availability(room, check_in, check_out):
|
|
avail_list = []
|
|
reservations_list = Booking.objects.filter(room=room)
|
|
for reservation in reservations_list:
|
|
if reservation.check_in > check_out or reservation.check_out < check_in:
|
|
avail_list.append(True)
|
|
else:
|
|
avail_list.append(False)
|
|
return all(avail_list)
|
|
|
|
|
|
def get_number_of_bookings(start_date, end_date):
|
|
pass |