(tablename,props)
return bool(count)
从数据库中删除
从数据库中删除
从数据库中删除
def DeleteFromDB(tablename,props):
    '''从数据库中删除
    '''
    prers = FormatCondition(props)
    sql = """DELETE FROM %s WHERE %s ;"""%(tablename,prers)
    conn = dbpool.connection(write=True,tablename=tablename)
    cursor = conn.cursor()
    count = 0
    try:
        count = cursor.execute(sql)
        conn.commit()
    except Exception,e:
        log.err(e,traceback.format_exc())
        log.err(sql)
    cursor.close()
    conn.close()
    return bool(count)
def DeleteFromDB ( tablename , props ) : prers = FormatCondition ( props ) sql = """DELETE FROM %s WHERE %s ;""" % ( tablename , prers ) conn = dbpool . connection ( write = True , tablename = tablename ) cursor = conn . cursor ( ) count = 0 try : count = cursor . execute ( sql ) conn . commit ( ) except Exception , e : log . err ( e , traceback . format_exc ( ) ) log . err ( sql ) cursor . close ( ) conn . close ( ) return bool ( count )