-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
32 lines (26 loc) · 1.43 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from flask import Flask, render_template
import repositories.booking_repository as booking_repository
import repositories.member_repository as member_repository
import repositories.lesson_repository as lesson_repository
import repositories.instructor_repository as instructor_repository
from controllers.lesson_controller import lessons_blueprint
from controllers.member_controller import members_blueprint
from controllers.booking_controller import bookings_blueprint
from controllers.instructor_controller import instructor_blueprint
app = Flask(__name__)
app.register_blueprint(lessons_blueprint)
app.register_blueprint(members_blueprint)
app.register_blueprint(bookings_blueprint)
app.register_blueprint(instructor_blueprint)
@app.route("/")
def index():
bookings_total = booking_repository.select_all_len()
members_total = member_repository.select_all_len()
lessons_total = lesson_repository.select_all_len()
instructor_total = instructor_repository.select_all_len()
member_list = member_repository.select_all()
lesson_list = lesson_repository.select_all()
instructor_list = instructor_repository.select_all()
return render_template("index.html", bookings_total = bookings_total, members_total = members_total, lessons_total = lessons_total, instructor_total = instructor_total, member_list = member_list, lesson_list = lesson_list, instructor_list = instructor_list)
if __name__ == "__main__":
app.run(debug=True)