randomfieldupdatehandler

class pdm_utils.classes.randomfieldupdatehandler.RandomFieldUpdateHandler(connection)

Bases: object

execute_ticket()

This function checks whether the ticket is valid. If it is not valid, the function returns with code 0, indicating failure to execute the ticket. If the ticket is valid, request input from the user to verify that they actually want to proceed with the update they’ve proposed. If response is in the affirmative, the ticket is executed. Otherwise, indicate that this ticket will be skipped, and return 0 as the ticket was not executed. If an error is encountered during execution of the ticket, print error message and return 0. If the ticket is executed without issue, return 1 indicating success. :return:

validate_field()

This function attempts to validate the replacement field by checking whether it’s on the list of fields in the indicated table. :return:

validate_key_name()

This function attempts to validate the selection key by checking whether it’s a field in the table marked as any kind of key. :return:

validate_key_value()

This function attempts to validate the selection key’s value by querying the database for the data associated with that key and value on the indicated table :return:

validate_table()

This function attempts to validate the table by simply querying for the table’s description. :return:

validate_ticket()

This function runs all 4 of the object’s built-in ticket validation methods, and checks whether any of the ticket inputs were invalid. If any are invalid, reject the ticket. If none are invalid, accept the ticket. :return: