todo.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:python_web 作者: lzhaoyang 项目源码 文件源码
def new_item():
    if request.GET.get('save','').strip():      #?????

        new=request.GET.get('task','').strip()

        conn=sqlite3.connect('todo.db')
        c=conn.cursor()

        c.execute('INSERT INTO todo (task,status) VALUES (?,?)',(new,1))
        new_id=c.lastrowid

        conn.commit()
        c.close()
        return "<p> the new task was inserted into the database,the id is %s</p>" % new_id
    else:
        return template('new_task.html')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号