summaryrefslogtreecommitdiff
path: root/ausbutler/interface.py
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-01-04 00:19:11 +0100
committeremkael <emkael@tlen.pl>2017-01-04 20:56:18 +0100
commitd0c93a1c1813213d2f55fa9b4c6798d131d08484 (patch)
treeca55fd7c531da5e7915c3bd07017e92e4064e014 /ausbutler/interface.py
parent970e12912cb139527753fce2709144deed1c764a (diff)
Model database creation interface
Diffstat (limited to 'ausbutler/interface.py')
-rw-r--r--ausbutler/interface.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py
new file mode 100644
index 0000000..95696c1
--- /dev/null
+++ b/ausbutler/interface.py
@@ -0,0 +1,14 @@
+from .db import Session
+
+
+class Interface:
+
+ def __init__(self):
+ self.session = Session()
+
+ def init_db(self, force=False):
+ from .model import Base
+ if force:
+ Base.metadata.drop_all(self.session.get_bind())
+ Base.metadata.create_all(self.session.get_bind())
+