From a5abdf6f6ad1c51a0aaea253560e742f690cb16d Mon Sep 17 00:00:00 2001 From: emkael Date: Wed, 29 Oct 2014 11:11:54 +0100 Subject: * moving find_driver to static Driver method --- import-csv.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'import-csv.py') 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 -- cgit v1.2.3