Exemple #1
0
def _input_to_dictionary(input_):
    """Convert.

    Args:
        input_: GraphQL "data" dictionary structure from mutation

    Returns:
        result: Dict of inputs

    """
    # 'column' is a dict of DB model 'non string' column names and their types
    column = {'idx_chart': DATA_INT, 'enabled': DATA_INT}
    result = utils.input_to_dictionary(input_, column=column)
    return result
Exemple #2
0
def _input_to_dictionary(input_):
    """Convert.

    Args:
        input_: GraphQL "data" dictionary structure from mutation

    Returns:
        result: Dict of inputs

    """
    # 'column' is a dict of DB model 'non string' column names and their types
    column = {'idx_user': DATA_INT, 'enabled': DATA_INT}

    # Get password and encrypt
    password = input_.get('password')
    if password is not None:
        input_['password'] = crypt.crypt(password)

    result = utils.input_to_dictionary(input_, column=column)
    return result