-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate_team.py
44 lines (33 loc) · 989 Bytes
/
update_team.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import streamlit as st
from frontend.utils.sidebar import set_sidebar
set_sidebar(
user={
"full_name": "John Doe",
"avatar_url": "https://avatars.githubusercontent.com/u/832385?s=200&v=4",
}
)
st.title("Update Team")
def get_team_id(supabase, div, roll_no):
try:
response = (
supabase.table("students")
.select("team_id")
.eq("div", div)
.eq("roll_no", roll_no)
.execute()
)
return response.data[0]["team_id"]
except Exception as e:
print(e)
return 0
def get_team_no(supabase, div, roll_no):
team_id = get_team_id(supabase, div, roll_no)
try:
response = supabase.table("teams").select("team_no").eq("id", team_id).execute()
return response.data[0]["team_no"]
except Exception as e:
print(e)
return 0
st.subheader(f"You are in team div - team_no")
if __name__ == "__main__":
st.write("Team number")