API - fix property name on some relationships

This commit is contained in:
Sam
2022-02-05 12:10:33 +01:00
parent bfea21bc3c
commit da95706a9d
2 changed files with 17 additions and 9 deletions

View File

@ -34,10 +34,14 @@ class User(BaseModel):
# does the week start Monday?
weekm = db.Column(db.Boolean(50), default=False, nullable=False)
workouts = db.relationship(
'Workout', lazy=True, backref=db.backref('user', lazy='joined')
'Workout',
lazy=True,
backref=db.backref('user', lazy='joined', single_parent=True),
)
records = db.relationship(
'Record', lazy=True, backref=db.backref('user', lazy='joined')
'Record',
lazy=True,
backref=db.backref('user', lazy='joined', single_parent=True),
)
language = db.Column(db.String(50), nullable=True)
imperial_units = db.Column(db.Boolean, default=False, nullable=False)