import cgi import cgitb from templates import yate cgitb.enable() form_data = cgi.FieldStorage() athlete_ID = form_data['ID'].value print(yate.start_response()) print(yate.include_header("Introducir el nueovo tiempo")) print(yate.start_form("AnadirTiempoDDBB.py")) print(yate.para("Añadir tiempo para el atleta con ID: {}".format(athlete_ID))) print(yate.text_field("tiempo", "Introducir Tiempo")) print(yate.hidden_input("ID", athlete_ID)) print(yate.end_form("Aceptar")) print(yate.include_footer({"Indice": "/cgi-bin/indice.py"}))
import glob from lib import athletemodel from templates import yate data_files = glob.glob("data/*.txt") athletes_info = athletemodel.get_namesID_from_store() print(yate.start_response()) print(yate.include_header("Coach Martin's List of Athletes")) print(yate.start_form("adding_time.py")) print(yate.para("Select an athlete from the list to add time:")) for each_athlete in athletes_info: print( yate.radio_button("which_athlete", each_athlete['name'], each_athlete['ID'])) print(yate.text_field("athlete_new_time", "athlete_new_time")) print(yate.end_form("Select")) print( yate.include_footer({ "Home": "/index.html", "Show timing athlete": "generate_list.py" }))