Refactor calendar (month and year view), switching to vertical slice arch. Also in progress of refactoring of stats so they are retreived after inital page load for performance sake

This commit is contained in:
Peter Stockings
2024-04-11 13:45:38 +10:00
parent 76789a4934
commit 63d997a3f1
7 changed files with 302 additions and 133 deletions

6
db.py
View File

@@ -6,13 +6,15 @@ from datetime import datetime
from dateutil.relativedelta import relativedelta
from urllib.parse import urlparse
from flask import g
from features.calendar import Calendar
from features.stats import Stats
from utils import count_prs_over_time, get_all_exercises_from_topsets, get_exercise_graph_model, get_stats_from_topsets, get_topsets_for_person, get_weekly_pr_graph_model, get_workout_counts, get_workouts
class DataBase():
def __init__(self, app):
self.calendar = Calendar(self.execute)
self.stats = Stats(self.execute)
db_url = urlparse(os.environ['DATABASE_URL'])
# if db_url is null then throw error
if not db_url: