-
Notifications
You must be signed in to change notification settings - Fork 0
/
page_model_no_db.py
33 lines (26 loc) · 1.03 KB
/
page_model_no_db.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
from sqlalchemy import Column, Integer, String
class PageModel():
main_img = Column(Integer)
compare_img_1 = Column(Integer)
compare_img_2 = Column(Integer)
chosen = Column(Integer)
def __init__(self, main_img=None, compare_img_1=None, compare_img_2=None,
main_path=None, compare_1_path=None, compare_2_path=None):
self.main_img = main_img
self.compare_img_1 = compare_img_1
self.compare_img_2 = compare_img_2
self.main_path = main_path
self.compare_1_path = compare_1_path
self.compare_2_path = compare_2_path
self.chosen = -1
def set_chosen(self, img):
self.chosen = img
def get_imgs_list(self):
return [self.main_path, self.compare_1_path, self.compare_2_path]
def get_index_list(self):
chosen = self.chosen
not_chosen = self.compare_img_1
if chosen == not_chosen:
chosen = self.compare_img_1
not_chosen = self.compare_img_2
return [self.main_img, chosen, not_chosen]