mralamdari commited on
Commit
c35efa3
·
verified ·
1 Parent(s): 6a43cac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -6
app.py CHANGED
@@ -9,23 +9,50 @@ shoelace_list = ['کشی', 'چسب دار', 'بند دار', 'بدون بند',
9
  sex_list = ['بزرگسال', 'بزرگسال زنانه', 'بزرگسال مردانه', 'بچگانه', 'بچگانه دختر', 'بچگانه پسر']
10
  sizes = [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, 45, 46, 47, 48, 49, 50]
11
 
12
- shoes_data = pd.read_excel('Book1.xlsx')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
 
 
14
  def show_shoes(sizes, types, colors, shoelaces, genders):
15
  shoes_arr = []
16
- selection = [list(map(int, sizes)), genders, colors, types, shoelaces]
17
- for i in range(len(shoes_data['code'].values)):
 
18
  Flag = True
19
  shoe_code,shoe_name,shoe_company,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
20
  shoes = [shoe_sizes.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_types.split('-'), shoe_shoelaces.split('-')]
21
  for select_details, shoe_details in zip(selection, shoes):
22
  if not select_details:
23
  continue
24
- for shoe_d in shoe_details:
25
- if shoe_d not in select_details:
26
  Flag = False
27
  break
28
-
29
  if not Flag:
30
  break
31
  if Flag:
 
9
  sex_list = ['بزرگسال', 'بزرگسال زنانه', 'بزرگسال مردانه', 'بچگانه', 'بچگانه دختر', 'بچگانه پسر']
10
  sizes = [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, 45, 46, 47, 48, 49, 50]
11
 
12
+ # shoes_data = pd.read_excel('Book1.xlsx')
13
+
14
+ # def show_shoes(sizes, types, colors, shoelaces, genders):
15
+ # shoes_arr = []
16
+ # selection = [list(map(int, sizes)), genders, colors, types, shoelaces]
17
+ # for i in range(len(shoes_data['code'].values)):
18
+ # Flag = True
19
+ # shoe_code,shoe_name,shoe_company,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
20
+ # shoes = [shoe_sizes.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_types.split('-'), shoe_shoelaces.split('-')]
21
+ # for select_details, shoe_details in zip(selection, shoes):
22
+ # if not select_details:
23
+ # continue
24
+ # for shoe_d in shoe_details:
25
+ # if shoe_d not in select_details:
26
+ # Flag = False
27
+ # break
28
+
29
+ # if not Flag:
30
+ # break
31
+ # if Flag:
32
+ # shoes_arr.append((f'./Img/{shoe_code}.jpg', f'Name: {shoe_name} ***** Code: {shoe_code} ***** Sizes: {shoe_sizes}'))
33
+
34
+ # if len(shoes_arr)==0:
35
+ # shoes_arr.append(('./Img/Empty.png', 'این کالا موجود نمی باشد'))
36
+ # return shoes_arr
37
 
38
+
39
+ shoes_data = pd.read_excel('Book1.xlsx')
40
  def show_shoes(sizes, types, colors, shoelaces, genders):
41
  shoes_arr = []
42
+ selection = [sizes, genders, colors, types, shoelaces]
43
+ print(selection)
44
+ for i in range(len(shoes_data)):
45
  Flag = True
46
  shoe_code,shoe_name,shoe_company,shoe_sizes,shoe_colors,shoe_shoelaces,shoe_sexes,shoe_types = shoes_data.iloc[i].values
47
  shoes = [shoe_sizes.split('-'), shoe_sexes.split('-'), shoe_colors.split('-'), shoe_types.split('-'), shoe_shoelaces.split('-')]
48
  for select_details, shoe_details in zip(selection, shoes):
49
  if not select_details:
50
  continue
51
+ for shoe_d in select_details:
52
+ if shoe_d not in shoe_details:
53
  Flag = False
54
  break
55
+
56
  if not Flag:
57
  break
58
  if Flag: