コード例 #1
0
def getTotalFats():
    app = create_app(True)
    app.app_context().push()
    db.drop_all()
    db.create_all()
    passwordHash = bcrypt.generate_password_hash("TestPassword").decode(
        'utf-8')
    user = User(username="******",
                email="*****@*****.**",
                password_hash=passwordHash)
    meal1 = Meal(food="Test Food One",
                 servings=1,
                 calories=100,
                 protein=1,
                 carbs=3,
                 fats=5,
                 owner=user)
    meal2 = Meal(food="Test Food Two",
                 servings=2,
                 calories=33,
                 protein=2,
                 carbs=4,
                 fats=6,
                 owner=user)
    db.session.add(meal1)
    db.session.add(meal2)
    db.session.commit()
コード例 #2
0
def addTest():
    app = create_app(True)
    app.app_context().push()
    db.drop_all()
    db.create_all()
    passwordHash = bcrypt.generate_password_hash("TestPassword").decode(
        'utf-8')
    user = User(username="******",
                email="*****@*****.**",
                password_hash=passwordHash)
    db.session.add(user)
    db.session.commit()
コード例 #3
0
def delete():
    app = create_app(True)
    app.app_context().push()
    db.drop_all()
    db.create_all()
コード例 #4
0
def addTUser():
    app = create_app(True)
    app.app_context().push()
    db.drop_all()
    db.create_all()
コード例 #5
0
ファイル: run.py プロジェクト: sjkchang/vigilant-waffle
from cloze import create_app

app = create_app(False)

if __name__ == '__main__':
    app.run(debug=True)