summaryrefslogtreecommitdiff
path: root/import-csv.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2014-10-29 11:11:54 +0100
committeremkael <emkael@tlen.pl>2014-10-29 11:11:54 +0100
commita5abdf6f6ad1c51a0aaea253560e742f690cb16d (patch)
tree6a96f0cb0d57632b6d7b19e1700b3fdaa780e9d6 /import-csv.py
parente8ef92b0254909df8291d144d72bcb837817cf51 (diff)
* moving find_driver to static Driver method
Diffstat (limited to 'import-csv.py')
-rw-r--r--import-csv.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/import-csv.py b/import-csv.py
index 49b699e..199fa5e 100644
--- a/import-csv.py
+++ b/import-csv.py
@@ -2,7 +2,6 @@ import csv
import sys
from f1elo.db import Session
-from f1elo.model import find_driver
from f1elo.model import *
session = Session()
@@ -18,10 +17,10 @@ with open(sys.argv[1]) as f:
entry.car_no = row[2]
entry.result_group = row[5]
session.add(entry)
- driver = find_driver(row[4].strip(), row[3].strip(), session)
+ driver = Driver.fetch(row[4].strip(), row[3].strip(), session)
entry.drivers.append(driver)
elif len(row) == 2:
- driver = find_driver(row[1].strip(), row[0].strip(), session)
+ driver = Driver.fetch(row[1].strip(), row[0].strip(), session)
entry.drivers.append(driver)
else:
print row