from lambda_app.reddit_data_model import User, DB, Thread, Comment
from flask import Flask, request

app = Flask(__name__)

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3'
DB.init_app(app)


@app.route('/')
def landing():
    user = User()
    user.id = 3
    user.name = 'Bill'
    # user.name = request.args['name']
    DB.session.add(user)
    DB.session.commit()
    users = User.query.all()
    return 'Users registered: ' + ', '.join([u.name for u in users])


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

from lambda_app.reddit_data_model import User, DB, Thread, Comment
from flask import Flask, request

app = Flask(__name__)

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3'
DB.init_app(app)


@app.route('/')
def landing():
    user = User()
    user.id = 3
    user.name = 'Bill'
    # user.name = request.args['name']
    DB.session.add(user)
    DB.session.commit()
    users = User.query.all()
    return 'Users registered: ' + ', '.join([u.name for u in users])


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

# user.name = request.args['name']