Switch to using render_partial instead of include

This commit is contained in:
Peter Stockings
2023-10-20 19:40:43 +11:00
parent ec9ec443e4
commit f340d1d3a9
4 changed files with 12 additions and 18 deletions

3
app.py
View File

@@ -1,4 +1,3 @@
from sqlalchemy import desc
from flask_basicauth import BasicAuth
import matplotlib.dates as mdates
import matplotlib.pyplot as plt
@@ -44,7 +43,7 @@ class User(db.Model):
bike_id = db.Column(db.Integer, db.ForeignKey(
'bikes.id', ondelete='CASCADE'), nullable=False)
workouts = db.relationship(
'Workout', backref='user', lazy=True, order_by='desc(Workout.created_at)') # 'Workout.created_at'
'Workout', backref='user', lazy=True, order_by='desc(Workout.created_at)')
bike = db.relationship('Bike', backref='user', lazy=True)