下面关于删除笔记功能路由器创建正确的是()
A. @app.route('/delete_article/', methods=['POST'])
B. @app.route('/delete_article/
C. @app('/delete_article/
D. @app.route('/delete_/
实现删除笔记功能的代码正确的是()
A. def delete_article(id):sql = "DELETE FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
B. 执行删除笔记的SQL语句db.delete(sql)
C. 删除数据库flash('删除成功', 'success')
D. 闪存信息return redirect(url_for('dashboard'))
E. 跳转到控制台
F. def delete_article(id):db = MysqlUtil()
G. 实例化数据库操作类sql = "DELETE FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
H. 执行删除笔记的SQL语句db.delete(sql)
I. 删除数据库return redirect(url_for('dashboard'))
J. 跳转到控制台
K. def delete_article(id):db = MysqlUtil()
L. 实例化数据库操作类sql = "DELETE FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
M. 执行删除笔记的SQL语句db.delete(sql)
N. 删除数据库flash('删除成功', 'success')
O. 闪存信息return redirect(url_for('dashboard'))
P. 跳转到控制台
Q. def delete_article(id):db = MysqlUtil()
R. 实例化数据库操作类sql = "DELETE FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
S. 执行删除笔记的SQL语句db.delete(sql)
T. 删除数据库flash('删除成功', 'success')
U. 闪存信息
下面关于查找需要编辑的笔记代码正确的一项是()
A. fetch_sql = "SELECT * FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
B. 根据笔记ID查找笔记信息article = db.fetchone(fetch_sql)
C. 查找一条记录
D. db = MysqlUtil()
E. 实例化数据库操作类fetch_sql = "SELECT * FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
F. 根据笔记ID查找笔记信息article = db.fetchone(fetch_sql)
G. 查找一条记录
H. db = MysqlUtil()
I. 实例化数据库操作类fetch_sql = "SELECT * FROM articles WHERE id = '%s' and author = '%s'" % (id,session['username'])
J. 根据笔记ID查找笔记信息article = db.fetchall(fetch_sql)
K. 查找一条记录
L. db = MysqlUtil()
M. 实例化数据库操作类fetch_sql = "SELECT * FROM articles WHERE id = '%s' and author = '%s'" % (id,session)
N. 根据笔记ID查找笔记信息article = db.fetchone(fetch_sql)
O. 查找一条记录
实现笔记功能时获取表单字段内容的代码是()
A. form = ArticleForm(request.form)if request.method == 'POST' and form.validate():
B. 如果用户提交表单,并且表单验证通过
C. 获取表单字段内容title = request.form['title']content = request.form['content']update_sql = "select articles SET title='%s', content='%s' WHERE id='%s' and author = '%s'" % (title, content, id,session['username'])db = MysqlUtil()
D. 实例化数据库操作类db.update(update_sql)
E. 更新数据的SQL语句flash('更改成功', 'success')
F. 闪存信息return redirect(url_for('dashboard'))
G. 跳转到控制台
H. if request.method == 'POST' and form.validate():
I. 如果用户提交表单,并且表单验证通过
J. 获取表单字段内容title = request.form['title']content = request.form['content']update_sql = "UPDATE articles SET title='%s', content='%s' WHERE id='%s' and author = '%s'" % (title, content, id,session['username'])db = MysqlUtil()
K. 实例化数据库操作类db.update(update_sql)
L. 更新数据的SQL语句flash('更改成功', 'success')
M. 闪存信息return redirect(url_for('dashboard'))
N. 跳转到控制台
O. form = ArticleForm(request.form)if request.method == 'POST' and form.validate():
P. 如果用户提交表单,并且表单验证通过
Q. 获取表单字段内容title = request.form['title']content = request.form['content']update_sql = "UPDATE articles SET title='%s', content='%s' WHERE id='%s' and author = '%s'" % (title, content, id,session['username'])db = MysqlUtil()
R. 实例化数据库操作类db.update(update_sql)
S. 更新数据的SQL语句flash('更改成功', 'success')
T. 闪存信息
U. form = ArticleForm(request.form)if request.method == 'POST' and form.validate():
V. 如果用户提交表单,并且表单验证通过
W. 获取表单字段内容title = request.form['title']content = request.form['content']update_sql = "UPDATE articles SET title='%s', content='%s' WHERE id='%s' and author = '%s'" % (title, content, id,session['username'])db = MysqlUtil()
X. 实例化数据库操作类db.update(update_sql)
Y. 更新数据的SQL语句flash('更改成功', 'success')
Z. 闪存信息return redirect(url_for('dashboard'))
[. 跳转到控制台