Ejemplo n.º 1
0
def update(command, cursor, connection):
    col = commons.get_unset_fields(command, columns, table_name, cursor)
    args = cursor.callproc('CONTACTS_tapi.upd', (parameter_getters.get_parameter_col(command, "-c", col), parameter_getters.get_parameter_col(command, "-s", col),
           parameter_getters.get_parameter_col(command, "-i", col), command[1],
           parameter_getters.get_parameter_col(command, "-t", col)))
    res = int(args[3])
    connection.commit()
    notifiers.notify_update(res)
Ejemplo n.º 2
0
def update(command, cursor, connection):
    col = commons.get_unset_fields(command, columns, table_name, cursor)
    res = cursor.callproc(
        'WORKERS_STATES_tapi.upd',
        (parameter_getters.get_parameter_col(command, "-d",
                                             col), int(command[1]),
         parameter_getters.get_parameter_col(command, "-n", col)))
    connection.commit()
    res = int(command[1])
    notifiers.notify_update(res)
Ejemplo n.º 3
0
def parameter_filter(command, col, short_name, long_name, column_type):
    if long_name == "id":
        return command[1]
    elif column_type == "int":
        return int(parameter_getters.get_parameter_col(command, short_name, col))
    elif column_type == "date":
        return get_date(parameter_getters.get_parameter_col(command,short_name, col))
    elif column_type == "time":
        return get_datetime(parameter_getters.get_parameter_col(command,short_name, col))
    else:
        return parameter_getters.get_parameter_col(command,short_name, col)
Ejemplo n.º 4
0
def update(command, cursor, connection):
    col = commons.get_unset_fields(command, columns, table_name, cursor)
    args = cursor.callproc('SERVICES_tapi.upd', (parameter_getters.get_parameter_col(command, "-p", col),
                                                 parameter_getters.get_parameter_col(command, "-d", col),
                                                 command[1],
                                                 parameter_getters.get_parameter_col(command, "-a", col),
                                                 parameter_getters.get_parameter_col(command, "-n", col)))
    res = int(args[2])
    connection.commit()
        
    notifiers.notify_update(res)
Ejemplo n.º 5
0
def update(command, cursor, connection):
    col = commons.get_unset_fields(command, columns, table_name, cursor)
    if len(command) >= 2:
        args = cursor.callproc(
            'SALARIES_tapi.upd',
            (int(parameter_getters.get_parameter_col(command, "-w", col)),
             int(parameter_getters.get_parameter_col(command, "-v", col)),
             int(parameter_getters.get_parameter_col(command, "-s", col)),
             int(parameter_getters.get_parameter_col(command, "-c",
                                                     col)), int(command[1])))
        res = int(args[4])
        connection.commit()
    notifiers.notify_update(res)
Ejemplo n.º 6
0
def update(command, cursor, connection):
    col = commons.get_unset_fields(command, columns, table_name, cursor)
    if len(command) >= 2:
        args = cursor.callproc(
            'PREMIUMS_SIZES_tapi.upd',
            (int(parameter_getters.get_parameter_col(command, "-min", col)),
             int(parameter_getters.get_parameter_col(command, "-max", col)),
             parameter_getters.get_parameter_col(command, "-d", col),
             command[1], parameter_getters.get_parameter_col(
                 command, "-n", col)))
        res = int(args[3])
        connection.commit()
    notifiers.notify_update(res)
Ejemplo n.º 7
0
def fake(command, cursor, connection):
    col = get_unset_fields(command, columns, table_name, cursor)
    print((parameter_getters.get_parameter_col(command, "-c", col), parameter_getters.get_parameter_col(command, "-s", col),
           parameter_getters.get_parameter_col(command, "-i", col), command[1],
           parameter_getters.get_parameter_col(command, "-t", col)))