diff options
author | emkael <emkael@tlen.pl> | 2017-01-04 00:19:11 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-01-04 20:56:18 +0100 |
commit | d0c93a1c1813213d2f55fa9b4c6798d131d08484 (patch) | |
tree | ca55fd7c531da5e7915c3bd07017e92e4064e014 /ausbutler/interface.py | |
parent | 970e12912cb139527753fce2709144deed1c764a (diff) |
Model database creation interface
Diffstat (limited to 'ausbutler/interface.py')
-rw-r--r-- | ausbutler/interface.py | 14 |
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()) + |