diff options
author | emkael <emkael@tlen.pl> | 2014-10-07 11:00:51 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2014-10-07 11:00:51 +0200 |
commit | 6298e63ddb46d01d9e272f8830186d1d7482751a (patch) | |
tree | 46d873294c03483859fb357be2d1663fa230ed87 /f1elo | |
parent | 7127fd85771045a62030dc9cef840a347b639308 (diff) |
* isort-ed imports
Diffstat (limited to 'f1elo')
-rw-r--r-- | f1elo/db.py | 8 | ||||
-rw-r--r-- | f1elo/elo.py | 6 | ||||
-rw-r--r-- | f1elo/model.py | 6 |
3 files changed, 9 insertions, 11 deletions
diff --git a/f1elo/db.py b/f1elo/db.py index 49ccc3d..dc40ba1 100644 --- a/f1elo/db.py +++ b/f1elo/db.py @@ -1,16 +1,15 @@ -import __main__ +import json from os import path +import __main__ +from f1elo.model import Driver from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker -import json - config = json.load(open(path.dirname(__main__.__file__) + '/config/db.json')) engine = create_engine("mysql://{0[user]}:{0[pass]}@{0[host]}/{0[db]}?charset=utf8".format(config)) Session = sessionmaker(bind=engine) -from f1elo.model import Driver def find_driver(name, country, session): driver = session.query(Driver).filter(Driver.driver==name).first() @@ -22,4 +21,3 @@ def find_driver(name, country, session): driver.country = country session.add(driver) return driver - diff --git a/f1elo/elo.py b/f1elo/elo.py index 3ddc6e4..cb35e6c 100644 --- a/f1elo/elo.py +++ b/f1elo/elo.py @@ -1,10 +1,10 @@ -import __main__ +import json +from itertools import combinations from os import path +import __main__ from f1elo.model import * -import json -from itertools import combinations class Elo: def __init__(self, session): diff --git a/f1elo/model.py b/f1elo/model.py index 3133a59..7b340fa 100644 --- a/f1elo/model.py +++ b/f1elo/model.py @@ -1,7 +1,7 @@ -from sqlalchemy import Column, Table, ForeignKey -from sqlalchemy.types import Date, Float, Integer, String, Boolean -from sqlalchemy.orm import backref, relationship, sessionmaker +from sqlalchemy import Column, ForeignKey, Table from sqlalchemy.ext.declarative import declarative_base +from sqlalchemy.orm import backref, relationship, sessionmaker +from sqlalchemy.types import Boolean, Date, Float, Integer, String Base = declarative_base() |