alion
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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
|
||||
Reference in New Issue
Block a user