Feat: update student list

This commit is contained in:
Bertrand Benjamin 2021-02-23 17:06:55 +01:00
parent 1855d4016d
commit 74d751a586
1 changed files with 29 additions and 0 deletions

View File

@ -120,4 +120,33 @@ layout = html.Div(
]
)
@app.callback(
[
dash.dependencies.Output("student", "options"),
dash.dependencies.Output("student", "value"),
],
[
dash.dependencies.Input("tribe", "value")
],)
def update_students_list(tribe):
tribe_config = [t for t in config["tribes"] if t["name"] == tribe][0]
students = get_students(tribe_config["students"])
options=[
{"label": t["Nom"], "value": t["Nom"]}
for t in students
]
value=students[0]["Nom"]
return options, value
# @app.callback(
# [
# dash.dependencies.Output("student-scores", "data"),
# ],
# [
# dash.dependencies.Input("tribe", "value"),
# dash.dependencies.Input("student", "value"),
# dash.dependencies.Input("term", "value"),
# ],
# )
# def update_student_scores(tribe, student, term):
# return []