from app import app, db
from app.models.tables import User


@app.route('/crud/insert')
def insert():
    i = User('helderwmarcos', '321', 'helder pcontrol',
        'helder.pcontrol@gmail.com')
    db.session.add(i)
    db.session.commit()
    return 'cadastrado com sucesso.'


@app.route('/crud/select', defaults={'info': None})
@app.route('/crud/select/<info>')
def select(info=None):
    r = User.query.get(2)
    print(r.username)
    return r.username


@app.route('/crud/update', defaults={'info': None})
@app.route('/crud/update/<info>')
def update(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    r.username = 'Helder W'
    db.session.add(r)
    db.session.commit()
    return 'alterado com sucesso.'


@app.route('/crud/delete', defaults={'info': None})
@app.route('/crud/delete/<info>')
def delete(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    db.session.delete(r)
    db.session.commit()
    return 'excluido com sucesso.'

01f594c43a0f7c1d9b3339495f71c12db0dbc9ef
<mask token>


@app.route('/crud/select', defaults={'info': None})
@app.route('/crud/select/<info>')
def select(info=None):
    r = User.query.get(2)
    print(r.username)
    return r.username


<mask token>


@app.route('/crud/delete', defaults={'info': None})
@app.route('/crud/delete/<info>')
def delete(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    db.session.delete(r)
    db.session.commit()
    return 'excluido com sucesso.'

<mask token>


@app.route('/crud/select', defaults={'info': None})
@app.route('/crud/select/<info>')
def select(info=None):
    r = User.query.get(2)
    print(r.username)
    return r.username


@app.route('/crud/update', defaults={'info': None})
@app.route('/crud/update/<info>')
def update(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    r.username = 'Helder W'
    db.session.add(r)
    db.session.commit()
    return 'alterado com sucesso.'


@app.route('/crud/delete', defaults={'info': None})
@app.route('/crud/delete/<info>')
def delete(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    db.session.delete(r)
    db.session.commit()
    return 'excluido com sucesso.'

<mask token>


@app.route('/crud/insert')
def insert():
    i = User('helderwmarcos', '321', 'helder pcontrol',
        'helder.pcontrol@gmail.com')
    db.session.add(i)
    db.session.commit()
    return 'cadastrado com sucesso.'


@app.route('/crud/select', defaults={'info': None})
@app.route('/crud/select/<info>')
def select(info=None):
    r = User.query.get(2)
    print(r.username)
    return r.username


@app.route('/crud/update', defaults={'info': None})
@app.route('/crud/update/<info>')
def update(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    r.username = 'Helder W'
    db.session.add(r)
    db.session.commit()
    return 'alterado com sucesso.'


@app.route('/crud/delete', defaults={'info': None})
@app.route('/crud/delete/<info>')
def delete(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    db.session.delete(r)
    db.session.commit()
    return 'excluido com sucesso.'

from app import app, db
from app.models.tables import User


@app.route('/crud/insert')
def insert():
    i = User('helderwmarcos', '321', 'helder pcontrol',
        'helder.pcontrol@gmail.com')
    db.session.add(i)
    db.session.commit()
    return 'cadastrado com sucesso.'


@app.route('/crud/select', defaults={'info': None})
@app.route('/crud/select/<info>')
def select(info=None):
    r = User.query.get(2)
    print(r.username)
    return r.username


@app.route('/crud/update', defaults={'info': None})
@app.route('/crud/update/<info>')
def update(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    r.username = 'Helder W'
    db.session.add(r)
    db.session.commit()
    return 'alterado com sucesso.'


@app.route('/crud/delete', defaults={'info': None})
@app.route('/crud/delete/<info>')
def delete(info=None):
    r = User.query.filter_by(username='helderwmarcos').first()
    db.session.delete(r)
    db.session.commit()
    return 'excluido com sucesso.'
