Exemplo n.º 1
0
def delete_entry():
	u = User(request.form['name'], request.form['email'])

	db_session.query(User).filter(User.name==u.name).delete()
	db_session.commit()

	flash('Selected User was successfully deleted')
	return redirect(url_for('show_entries'))
Exemplo n.º 2
0
def update_entry():
	u = db_session.query(User).filter(User.name==request.form['name']).first()
	u.description = 'my description'

	db_session.commit()

	print '##########'
	print u.description

	return redirect(url_for('show_entries'))
Exemplo n.º 3
0
def add_entry():
	if not session.get('logged_in'):
		abort(401)

	u = User(request.form['name'], request.form['email'])
	db_session.add(u)
	db_session.commit()

	flash('New User was successfully posted')
	return redirect(url_for('show_entries'))