mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
108536234: created users and roles data and domain model.
You will need to run the /scripts/bootstrap.sh to create the database for test and the app.
This commit is contained in:
0
app/main/dao/__init__.py
Normal file
0
app/main/dao/__init__.py
Normal file
11
app/main/dao/roles_dao.py
Normal file
11
app/main/dao/roles_dao.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from app import db
|
||||
from app.models import Roles
|
||||
|
||||
|
||||
def insert_role(role):
|
||||
db.session.add(role)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def get_role_by_id(id):
|
||||
return Roles.query.filter_by(id=id).first()
|
||||
11
app/main/dao/users_dao.py
Normal file
11
app/main/dao/users_dao.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from app import db
|
||||
from app.models import Users
|
||||
|
||||
|
||||
def insert_user(user):
|
||||
db.session.add(user)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def get_user_by_id(id):
|
||||
return Users.query.filter_by(id=id).first()
|
||||
Reference in New Issue
Block a user