DrDomedag commited on
Commit
426453a
·
1 Parent(s): 0f6f0b9

Starting individual user profile pages.

Browse files
Files changed (2) hide show
  1. pages/dish_planning.py +6 -3
  2. utils/variables.py +2 -4
pages/dish_planning.py CHANGED
@@ -9,8 +9,8 @@ st.write("Welcome to the dish planning page!")
9
  st.write("Dish ingredients:")
10
  for i in ingredient_list:
11
  allergic_people_count = 0
12
- for u in user_list:
13
- if i in u.keys():
14
  allergic_people_count += 1
15
  else:
16
  found = False
@@ -18,7 +18,7 @@ for i in ingredient_list:
18
  if found:
19
  break
20
  else:
21
- if s in u.keys():
22
  allergic_people_count += 1
23
  found = True
24
  break
@@ -28,6 +28,9 @@ for i in ingredient_list:
28
  else:
29
  st.write(f"{i}")
30
 
 
 
 
31
  # Text input for the search query
32
  query = st.text_input("Search for an ingredient:")
33
 
 
9
  st.write("Dish ingredients:")
10
  for i in ingredient_list:
11
  allergic_people_count = 0
12
+ for u in user_list.keys():
13
+ if i in user_list[u].keys():
14
  allergic_people_count += 1
15
  else:
16
  found = False
 
18
  if found:
19
  break
20
  else:
21
+ if s in user_list[u].keys():
22
  allergic_people_count += 1
23
  found = True
24
  break
 
28
  else:
29
  st.write(f"{i}")
30
 
31
+
32
+
33
+
34
  # Text input for the search query
35
  query = st.text_input("Search for an ingredient:")
36
 
utils/variables.py CHANGED
@@ -1,8 +1,6 @@
1
  from collections import defaultdict
2
 
3
-
4
- #user_allergen_list = ["Gluten"]
5
- ingredient_list = ["Egg"]
6
 
7
  # Init user profiles
8
 
@@ -11,7 +9,7 @@ user_1_list = defaultdict(lambda: (0, False))
11
  user_2_list = defaultdict(lambda: (0, False))
12
  user_3_list = defaultdict(lambda: (0, False))
13
 
14
- user_0_list["Gluten"] = (2, False)
15
 
16
  user_list = {}
17
  user_list[0] = user_0_list
 
1
  from collections import defaultdict
2
 
3
+ ingredient_list = []
 
 
4
 
5
  # Init user profiles
6
 
 
9
  user_2_list = defaultdict(lambda: (0, False))
10
  user_3_list = defaultdict(lambda: (0, False))
11
 
12
+ #user_0_list["Gluten"] = (2, False)
13
 
14
  user_list = {}
15
  user_list[0] = user_0_list