diff options
author | François Schmidts <francois.schmidts@gmail.com> | 2015-01-17 16:50:38 +0100 |
---|---|---|
committer | François Schmidts <francois.schmidts@gmail.com> | 2015-03-03 22:22:14 +0100 |
commit | 2849c82255b4b889c7342a0a8fa8a4aecfbe599d (patch) | |
tree | 3ad31fd3a0e84bc3f40367cf4963cf8db8c65d06 /db_create.py | |
parent | adding news fields and migrations scripts (diff) | |
download | newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.tar.gz newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.tar.bz2 newspipe-2849c82255b4b889c7342a0a8fa8a4aecfbe599d.zip |
a first big refacto of the existing arch
Diffstat (limited to 'db_create.py')
-rwxr-xr-x | db_create.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/db_create.py b/db_create.py index 8e743515..c10e4d43 100755 --- a/db_create.py +++ b/db_create.py @@ -10,8 +10,8 @@ __license__ = "AGPLv3" import os import bootstrap +from flask import g -from pyaggr3g470r import db from pyaggr3g470r.models import User, Role from werkzeug import generate_password_hash @@ -64,8 +64,8 @@ def db_DropEverything(db): trans.commit() -db_DropEverything(db) -db.create_all() +db_DropEverything(g.db) +g.db.create_all() role_admin = Role(name="admin") role_user = Role(name="user") @@ -76,5 +76,5 @@ user1 = User(nickname="admin", activation_key="") user1.roles.extend([role_admin, role_user]) -db.session.add(user1) -db.session.commit() +g.db.session.add(user1) +g.db.session.commit() |