def edit_yogaclass(id):
    yogaclass = yogaclass_repository.select(id)
    instructors = instructor_repository.select_all()
    return render_template('yogaclasses/edit.html',
                           title="Edit Class",
                           selected_yogaclass=yogaclass,
                           all_instructors=instructors)
def instructors():
    instructors = instructor_repository.select_all()
    yogaclasses = yogaclass_repository.select_all()
    return render_template("instructors/index.html",
                           title="Instructors",
                           all_instructors=instructors,
                           all_yogaclasses=yogaclasses)
def new_class():
    todays_date = str(date.today())
    all_instructors = instructor_repository.select_all()
    all_locations = location_repository.select_all()
    return render_template('/gym_classes/new.html',
                           title="Add new class",
                           instructors=all_instructors,
                           locations=all_locations,
                           date=todays_date)
def edit_class(id):
    todays_date = str(date.today())
    gym_class = gym_class_repository.select(id)
    all_instructors = instructor_repository.select_all()
    all_locations = location_repository.select_all()
    return render_template('/gym_classes/edit.html',
                           title="Edit class",
                           gym_class=gym_class,
                           instructors=all_instructors,
                           locations=all_locations,
                           date=todays_date)
workout_repository.delete_all()
instructor_repository.delete_all()
member_repository.delete_all()

#Default Instructors
instructor_1 = Instructor("Fran", 44, "HIIT")
instructor_repository.save(instructor_1)

instructor_2 = Instructor("White Goodman", 45, "Yoga")
instructor_repository.save(instructor_2)

instructor_3 = Instructor("Me'Shell Jones", 35, "Cycle")
instructor_repository.save(instructor_3)

instructor_test = instructor_repository.select_all()
print(instructor_test[0].name)

#INSTRUCTOR_REPOSITORY
#Save function - working
#Select all function - working
#Select by id function - working
#Delete all functon - working
#Delete by id function - working
#Update function - working

#Default Members
member_1 = Member("Cameron", 25, "Gold")
member_repository.save(member_1)

member_2 = Member("Rory", 46, "Silver")
def new_yogaclass():
    instructors = instructor_repository.select_all()
    return render_template("yogaclasses/new.html",
                           title="Add Class",
                           all_instructors=instructors)
def instructors():
    instructors = instructor_repository.select_all()
    return render_template("instructors/index.html", instructors=instructors)
def index():
    all_instructors = instructor_repository.select_all()
    return render_template('instructors/index.html',
                           title="Instructors",
                           instructors=all_instructors)