def select_post(filename=None, form=None, form_dict=None, method=None, this_page=None, back_page=None, next_page=None, edit_page=None, project_node_id=None, reupload_page=None):
    node_id = None
    new_page = None
    if form_dict:
        for key in form_dict:
            val = form_dict[key][0]
            if (val in (BTN_BACK, BTN_DONE)):
                new_page = back_page
            elif (val[0:4] == BTN_BACK):
                node_id = project_node_id
                new_page = back_page
            elif (val in [BTN_NEXT, BTN_SAVE_AND_CONTINUE]):
                node_id = project_node_id
                new_page = next_page
            elif (val == BTN_EDIT):
                new_page = edit_page
                node_id = key
            elif (val == BTN_REMOVE):
                new_page = this_page
                node_id = key
                eml_node = load_eml(filename=filename)
                remove_child(node_id=node_id)
                node_id = project_node_id
                save_both_formats(filename=filename, eml_node=eml_node)
            elif (val == BTN_REUPLOAD):
                node_id = key
                if reupload_page:
                    new_page = reupload_page
                else:
                    node_id = key
                    new_page = PAGE_REUPLOAD
            elif (val == BTN_HIDDEN_CHECK):
                new_page = PAGE_CHECK
            elif (val == BTN_HIDDEN_SAVE):
                new_page = this_page
            elif (val == BTN_HIDDEN_DOWNLOAD):
                new_page = PAGE_DOWNLOAD
            elif (val == BTN_HIDDEN_NEW):
                new_page = PAGE_CREATE
            elif (val == BTN_HIDDEN_OPEN):
                new_page = PAGE_OPEN
            elif (val == BTN_HIDDEN_CLOSE):
                new_page = PAGE_CLOSE
            elif (val == UP_ARROW):
                new_page = this_page
                node_id = key
                process_up_button(filename, node_id)
            elif (val == DOWN_ARROW):
                new_page = this_page
                node_id = key
                process_down_button(filename, node_id)
            elif (val[0:3] == BTN_ADD):
                new_page = edit_page
                node_id = '1'
            elif (val == BTN_LOAD_DATA_TABLE):
                new_page = PAGE_LOAD_DATA
                node_id = '1'
            elif (val == BTN_LOAD_GEO_COVERAGE):
                new_page = PAGE_LOAD_GEO_COVERAGE
                node_id = '1'
            elif (val == BTN_LOAD_OTHER_ENTITY):
                new_page = PAGE_LOAD_OTHER_ENTITY
                node_id = '1'
            elif (val == BTN_REUSE):
                new_page = PAGE_IMPORT_PARTY
                node_id = '1'
    if form.validate_on_submit():
        if (new_page in [PAGE_DATA_TABLE, PAGE_LOAD_DATA, PAGE_REUPLOAD, PAGE_REUPLOAD_WITH_COL_NAMES_CHANGED]):
            return url_for(new_page, filename=filename, dt_node_id=node_id, project_node_id=project_node_id)
        else:
            return url_for(new_page, filename=filename, node_id=node_id, project_node_id=project_node_id)
def select_post(filename=None, form=None, form_dict=None, method=None, this_page=None, back_page=None, next_page=None, edit_page=None, project_node_id=None, reupload_page=None):
    node_id = None
    new_page = None
    if form_dict:
        for key in form_dict:
            val = form_dict[key][0]
            if (val in (BTN_BACK, BTN_DONE)):
                new_page = back_page
            elif (val[0:4] == BTN_BACK):
                node_id = project_node_id
                new_page = back_page
            elif (val in [BTN_NEXT, BTN_SAVE_AND_CONTINUE]):
                node_id = project_node_id
                new_page = next_page
            elif (val == BTN_EDIT):
                new_page = edit_page
                node_id = key
            elif (val == BTN_REMOVE):
                new_page = this_page
                node_id = key
                eml_node = load_eml(filename=filename)
                remove_child(node_id=node_id)
                node_id = project_node_id
                save_both_formats(filename=filename, eml_node=eml_node)
            elif (val == BTN_REUPLOAD):
                node_id = key
                if reupload_page:
                    new_page = reupload_page
                else:
                    node_id = key
                    new_page = PAGE_REUPLOAD
            elif (val == BTN_HIDDEN_CHECK):
                new_page = PAGE_CHECK
            elif (val == BTN_HIDDEN_SAVE):
                new_page = this_page
            elif (val == BTN_HIDDEN_DOWNLOAD):
                new_page = PAGE_DOWNLOAD
            elif (val == BTN_HIDDEN_NEW):
                new_page = PAGE_CREATE
            elif (val == BTN_HIDDEN_OPEN):
                new_page = PAGE_OPEN
            elif (val == BTN_HIDDEN_CLOSE):
                new_page = PAGE_CLOSE
            elif (val == UP_ARROW):
                new_page = this_page
                node_id = key
                process_up_button(filename, node_id)
            elif (val == DOWN_ARROW):
                new_page = this_page
                node_id = key
                process_down_button(filename, node_id)
            elif (val[0:3] == BTN_ADD):
                new_page = edit_page
                node_id = '1'
            elif (val == BTN_LOAD_DATA_TABLE):
                new_page = PAGE_LOAD_DATA
                node_id = '1'
            elif (val == BTN_LOAD_GEO_COVERAGE):
                new_page = PAGE_LOAD_GEO_COVERAGE
                node_id = '1'
            elif (val == BTN_LOAD_OTHER_ENTITY):
                new_page = PAGE_LOAD_OTHER_ENTITY
                node_id = '1'
            elif (val == BTN_REUSE):
                new_page = PAGE_IMPORT_PARTY
                node_id = '1'
    if form.validate_on_submit():
        if (new_page in [PAGE_DATA_TABLE, PAGE_LOAD_DATA, PAGE_REUPLOAD, PAGE_REUPLOAD_WITH_COL_NAMES_CHANGED]):
            return url_for(new_page, filename=filename, dt_node_id=node_id, project_node_id=project_node_id)
        else:
            return url_for(new_page, filename=filename, node_id=node_id, project_node_id=project_node_id)