Work in progress, skeleton of the api created and testing started. Need to fix authentication tests.

This commit is contained in:
Nicholas Staples
2016-01-08 17:51:46 +00:00
parent 5bcc615825
commit 0bc4d02713
29 changed files with 193 additions and 95 deletions

20
app/dao/users_dao.py Normal file
View File

@@ -0,0 +1,20 @@
from datetime import datetime
from sqlalchemy.orm import load_only
from app import db
from app.models import User
def create_user(email_address):
user = User(email_address=email_address,
created_at=datetime.now())
db.session.add(user)
db.session.commit()
return user.id
def get_users(user_id=None):
if user_id:
return User.query.filter_by(id=user_id).one()
return User.query.filter_by().all()