summaryrefslogtreecommitdiff
path: root/f1elo/interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'f1elo/interface.py')
-rw-r--r--f1elo/interface.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/f1elo/interface.py b/f1elo/interface.py
index 3768f8a..a492bba 100644
--- a/f1elo/interface.py
+++ b/f1elo/interface.py
@@ -58,7 +58,7 @@ class Interface:
race_query = self.session.query(Race).filter(Race.ranked == False)
if date is not None:
race_query = race_query.filter(Race.date <= date)
- races = race_query.order_by(Race.date).all()
+ races = race_query.order_by(Race.date, Race.id).all()
for race in races:
if _debug:
@@ -76,7 +76,7 @@ class Interface:
for driver, rank in driver_ranks.iteritems():
ranking = Ranking()
ranking.rank_date = race.date
- ranking.ranking = elo.get_ranking(driver, race.date) + rank
+ ranking.ranking = round(elo.get_ranking(driver, race.date) + rank, 2)
self.session.add(ranking)
driver.rankings.append(ranking)