aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-03-18 18:05:53 +0000
committerrubenwardy <rw@rubenwardy.com>2018-03-18 18:05:53 +0000
commit7d20c49ebb2a59e54a77ab92f268acd7fe069383 (patch)
tree6d28dfd1eeb8c13cfa82ff965b138e4b3634292b /setup.py
parent7f4faf21fae08c5e661c8f45ebda570dec3e8996 (diff)
downloadcheatdb-7d20c49ebb2a59e54a77ab92f268acd7fe069383.tar.xz
Add Github login
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 0ba2b5a..9949776 100644
--- a/setup.py
+++ b/setup.py
@@ -6,12 +6,15 @@ if delete_db and os.path.isfile("app/data.sqlite"):
os.remove("app/data.sqlite")
if not os.path.isfile("app/data.sqlite"):
- from app import models
+ from app.models import *
print("Creating database tables...")
- models.db.create_all()
-
+ db.create_all()
print("Filling database...")
- models.db.session.commit()
+
+ ruben = User("rubenwardy")
+ ruben.github_username = "rubenwardy"
+ db.session.add(ruben)
+ db.session.commit()
else:
print("Database already exists")