Introduces ordering for pitstops

Pitstops are now ordered by ascending odometer value instead of
their id
This commit is contained in:
Joachim Lusiardi 2018-08-11 13:15:33 +02:00
parent 879669b4f7
commit c42a667ca4
1 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,8 @@ class Vehicle(db.Model):
owner_id = db.Column(db.Integer, db.ForeignKey('user.id')) owner_id = db.Column(db.Integer, db.ForeignKey('user.id'))
name = db.Column(db.String(255)) name = db.Column(db.String(255))
pitstops = db.relationship( pitstops = db.relationship(
'Pitstop' 'Pitstop',
order_by="asc(Pitstop.odometer)"
) )
services = db.relationship( services = db.relationship(
'Service' 'Service'