summaryrefslogtreecommitdiff
path: root/elo.py
diff options
context:
space:
mode:
Diffstat (limited to 'elo.py')
-rwxr-xr-xelo.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/elo.py b/elo.py
index 8729652..8df3e3c 100755
--- a/elo.py
+++ b/elo.py
@@ -1,10 +1,12 @@
#!/usr/bin/env python
+import argparse
+import datetime
+
+import dateutil.parser
+import dateutil.relativedelta
from f1elo.db import Session
-from f1elo.model import *
from f1elo.elo import Elo
-import dateutil.parser, dateutil.relativedelta
-import datetime
-import argparse
+from f1elo.model import *
session = Session()
elo = Elo(session)
@@ -82,6 +84,7 @@ if len(rankings):
if not drivers.has_key(ranking.driver):
drivers[ranking.driver] = ranking.driver.get_ranking(date)
+
for rank in sorted(drivers.values(), key=lambda rank: rank.ranking, reverse=True):
print rank
else: