diyca_web_utilities.py 文件源码

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

项目:diyca 作者: texadactyl 项目源码 文件源码
def dbuser_remove(arg_userid):
    global dbconn
    if app.debug:
        app.logger.debug("dbuser_remove: arg_userid=%s", arg_userid)
    try:
        dbcursor = dbconn.cursor() 
        dbcursor.execute("DELETE FROM {tn} WHERE {cn1}='{cv1}'" \
                         .format(tn=ddl.TBL_USER, \
                                 cn1=ddl.FLD_USER_ID, cv1=arg_userid))
        dbconn.commit()
    except sqlite3.Error as e:
        app.logger.error("dbuser_remove: DELETE {%s} failed, reason: {%s}", arg_userid, repr(e))
        return False
    # Success
    return True

#========================
# Initialize the database
#========================
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号