summaryrefslogtreecommitdiff
path: root/ausbutler
diff options
context:
space:
mode:
Diffstat (limited to 'ausbutler')
-rw-r--r--ausbutler/model.py10
-rw-r--r--ausbutler/tour_config.py4
2 files changed, 11 insertions, 3 deletions
diff --git a/ausbutler/model.py b/ausbutler/model.py
index fc088fa..d3e4c27 100644
--- a/ausbutler/model.py
+++ b/ausbutler/model.py
@@ -1,5 +1,5 @@
from cached_property import cached_property
-from sqlalchemy import Column, MetaData, Table, func
+from sqlalchemy import Column, MetaData, Table, func, join, literal
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.types import Float, Integer, String
@@ -82,3 +82,11 @@ class Admin(Base):
__table__ = Table('admin', MetaData(bind=session.bind),
Column('shortname', String, primary_key=True),
autoload=True)
+
+class Params(Base):
+ __table__ = Table('params', MetaData(bind=session.bind),
+ Column('datasource', Integer, primary_key=True),
+ autoload=True)
+
+class Parameters(Base):
+ __table__ = join(Admin, Params, literal(True))
diff --git a/ausbutler/tour_config.py b/ausbutler/tour_config.py
index 43a8dc7..bf6451d 100644
--- a/ausbutler/tour_config.py
+++ b/ausbutler/tour_config.py
@@ -1,6 +1,6 @@
from .config import load_config
from .db import get_session
-from .model import Translation, Admin
+from .model import Translation, Parameters
session = get_session()
@@ -23,4 +23,4 @@ class Translations(object):
def detect_language():
return 'en' if Translations.get_translation('ROUND').lower().strip() == 'round' else 'pl'
-Constants = session.query(Admin).one()
+Constants = session.query(Parameters).one()