Skip to content

Commit e6e39b4

Browse files
committed
feat: add page for updating team
1 parent 51823d1 commit e6e39b4

File tree

3 files changed

+44
-155
lines changed

3 files changed

+44
-155
lines changed

frontend/components/add_team_page.py

-155
This file was deleted.

frontend/utils/_init_.py

Whitespace-only changes.

pages/update_team.py

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

0 commit comments

Comments
 (0)