(project_id:Union[int, str], user_id, op_type:str, location=None, freetext=None)
return None
Inserts a new entry into the log table. If the location parameter is
    passed, it is expected to be an iteratable (list, tuple).
Inserts a new entry into the log table. If the location parameter is
    passed, it is expected to be an iteratable (list, tuple).
Inserts a new entry into the log table . If the location parameter is passed it is expected to be an iteratable ( list tuple ) .
def insert_into_log(project_id:Union[int, str], user_id, op_type:str, location=None, freetext=None) -> Optional[Dict[str, str]]:
    """ Inserts a new entry into the log table. If the location parameter is
    passed, it is expected to be an iteratable (list, tuple).
    """
    # valid operation types
    operation_type_array = [
        "rename_root",
        "create_neuron",
        "rename_neuron",
        "remove_neuron",
        "move_neuron",

        "create_group",
        "rename_group",
        "remove_group",
        "move_group",

        "create_skeleton",
        "rename_skeleton",
        "remove_skeleton",
        "move_skeleton",

        "split_skeleton",
        "join_skeleton",
        "reroot_skeleton",

        "change_confidence",

        "reset_reviews"
    ]

    if op_type not in operation_type_array:
        raise ValueError(f'Operation type {op_type} not valid')

    new_log = Log()
    new_log.user_id = user_id
    new_log.project_id = project_id
    new_log.operation_type = op_type
    if location is not None:
        new_log.location = Double3D(*location)
    if freetext is not None:
        new_log.freetext = freetext

    new_log.save()
    return None
def insert_into_log ( project_id : Union [ int , str ] , user_id , op_type : str , location = None , freetext = None ) -> Optional [ Dict [ str , str ] ] : # valid operation types operation_type_array = [ "rename_root" , "create_neuron" , "rename_neuron" , "remove_neuron" , "move_neuron" , "create_group" , "rename_group" , "remove_group" , "move_group" , "create_skeleton" , "rename_skeleton" , "remove_skeleton" , "move_skeleton" , "split_skeleton" , "join_skeleton" , "reroot_skeleton" , "change_confidence" , "reset_reviews" ] if op_type not in operation_type_array : raise ValueError ( f'Operation type {op_type} not valid' ) new_log = Log ( ) new_log . user_id = user_id new_log . project_id = project_id new_log . operation_type = op_type if location is not None : new_log . location = Double3D ( * location ) if freetext is not None : new_log . freetext = freetext new_log . save ( ) return None