def update(cursor, table, where_kv, commit=True, **field_values):
    """
    db update 쿼리 빌딩 및 실행, 단, commit은
    :param cursor: 커서
    :type cursor: Cursor
    :param table: 테이블 이름
    :type table: str
    :param where_kv: 업데이트 where 조건 dictionary, key:field, value:equal condition only
    :type where_kv: dict
    :param field_values: kwarg 업데이트용
    :type field_values: dict
    :param commit: 커밋 여부
    :type commit: bool
    :return:
    """

    q = """update %s \nset {0} \nwhere {1} """ % table

    fields = field_values.keys()
    kv = ','.join(['{}=%s'.format(f) for f in fields])

    where = ' and '.join(['{}=%s'.format(f) for f in where_kv.keys()])

    q = q.format(kv, where)
    args = field_values.values() + where_kv.values()

    cursor.execute(q, args=args)
    if commit:
        cursor.connection.commit()
def update(cursor, table, where_kv, commit=True, **field_values):
    """
    db update 쿼리 빌딩 및 실행, 단, commit은
    :param cursor: 커서
    :type cursor: Cursor
    :param table: 테이블 이름
    :type table: str
    :param where_kv: 업데이트 where 조건 dictionary, key:field, value:equal condition only
    :type where_kv: dict
    :param field_values: kwarg 업데이트용
    :type field_values: dict
    :param commit: 커밋 여부
    :type commit: bool
    :return:
    """

    q = """update %s \nset {0} \nwhere {1} """ % table

    fields = field_values.keys()
    kv = ','.join(['{}=%s'.format(f) for f in fields])

    where = ' and '.join(['{}=%s'.format(f) for f in where_kv.keys()])

    q = q.format(kv, where)
    args = field_values.values() + where_kv.values()

    cursor.execute(q, args=args)
    if commit:
        cursor.connection.commit()
def update ( cursor , table , where_kv , commit = True , * * field_values ) : q = """update %s \nset {0} \nwhere {1} """ % table fields = field_values . keys ( ) kv = ',' . join ( [ '{}=%s' . format ( f ) for f in fields ] ) where = ' and ' . join ( [ '{}=%s' . format ( f ) for f in where_kv . keys ( ) ] ) q = q . format ( kv , where ) args = field_values . values ( ) + where_kv . values ( ) cursor . execute ( q , args = args ) if commit : cursor . connection . commit ( )
db update 쿼리 빌딩 및 실행, 단, commit은
    :param cursor: 커서
    :type cursor: Cursor
    :param table: 테이블 이름
    :type table: str
    :param where_kv: 업데이트 where 조건 dictionary, key:field, value:equal condition only
    :type where_kv: dict
    :param field_values: kwarg 업데이트용
    :type field_values: dict
    :param commit: 커밋 여부
    :type commit: bool
    :return:
db update 쿼리 빌딩 및 실행 단 commit은 : param cursor : 커서 : type cursor : Cursor : param table : 테이블 이름 : type table : str : param where_kv : 업데이트 where 조건 dictionary key : field value : equal condition only : type where_kv : dict : param field_values : kwarg 업데이트용 : type field_values : dict : param commit : 커밋 여부 : type commit : bool : return :