fix bug
This commit is contained in:
parent
70f093e1a1
commit
ea66c31a07
|
@ -98,14 +98,22 @@ class FilterForm(FlaskForm):
|
||||||
filter = SelectField('', choices=DEVICES, default="Computer",
|
filter = SelectField('', choices=DEVICES, default="Computer",
|
||||||
render_kw={'class': "form-select"})
|
render_kw={'class': "form-select"})
|
||||||
|
|
||||||
def search(self):
|
def __init__(self, *args, **kwargs):
|
||||||
device = dict(DEVICES).get(request.args.get('filter'))
|
super().__init__(*args, **kwargs)
|
||||||
|
self.device = dict(DEVICES).get(request.args.get('filter'))
|
||||||
|
if self.device:
|
||||||
|
self.filter.data = self.device
|
||||||
|
|
||||||
if device == "Computer":
|
def search(self):
|
||||||
|
|
||||||
|
if self.device == "Computer":
|
||||||
return ['Desktop', 'Laptop', 'Server']
|
return ['Desktop', 'Laptop', 'Server']
|
||||||
|
|
||||||
if device:
|
if self.device == "DataStorage":
|
||||||
return [device]
|
return ['HardDrive', 'SolidStateDrive']
|
||||||
|
|
||||||
|
if self.device:
|
||||||
|
return [self.device]
|
||||||
|
|
||||||
return ['Desktop', 'Laptop', 'Server']
|
return ['Desktop', 'Laptop', 'Server']
|
||||||
|
|
||||||
|
|
Reference in New Issue