def make_reservation(self): print("Reservation System") print("########################") curr_user = current_user.get_cu() if curr_user is None: print("Something is wrong. Someone must be logged in, please login first") return current_user_id = curr_user.id reserv_sys = Reservation_system() matches = reserv_sys.get_matched_users(current_user_id) if not matches: print("Sorry you dont have any matches to make reservations with") return print("Your current matches include: ") print("########################") x = 1 for record in matches: print(record) x = x + 1 print("########################") match_id = input("Please add the user id of the match you want to book for: ") deals_sys = Deals_system() print("Current deals available include: ") print("########################") deals_sys = Deals_system() deals = deals_sys.all_deals_list() if not deals: print("Sorry no deals available at this time!") return x = 1; for record in deals: print("Deal ", x) print(record) x = x + 1 print("########################") deal_id = input("Please add the deal id of the deal you want to book for: ") print("########################") start_time = input("Please specify reservation start time in format HH:MM: ") end_time = input("Please specify reservation end time: in format HH:MM: ") date_of_meeting = input("Please specify reservation date in format YYYY-MM-DD: ") print("########################") date_time_obj = datetime.strptime(date_of_meeting, '%Y-%m-%d') check = reserv_sys.check_date(deal_id, date_time_obj.date()) if not check: message = "You either tried to book for an expired deal or booked a date before today, please go back an try again. " return message result = reserv_sys.add_meeting(deal_id, match_id, date_time_obj.date(), start_time, end_time) print("Meeting booked with the following information:") print(result)
def view_deals(self): print("All deals currently available") print("########################") deals_sys = Deals_system() result = deals_sys.all_deals_list() x = 1; for record in result: print("Deal ", x) print(record) x = x + 1
def deals_list(): if request.method == 'GET': deals_sys = Deals_system() result = deals_sys.all_deals_list() # return jsonify(result) return render_template('deals.html', list=result)