diff options
-rw-r--r-- | ausbutler/interface.py | 14 | ||||
-rw-r--r-- | butler.py | 4 |
2 files changed, 18 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()) + diff --git a/butler.py b/butler.py new file mode 100644 index 0000000..0f537a4 --- /dev/null +++ b/butler.py @@ -0,0 +1,4 @@ +from ausbutler.interface import Interface + +i = Interface() +i.init_db() |