7
7
Pathogen ,
8
8
Signal ,
9
9
TimeLabelChoices ,
10
+ ActiveChoices
10
11
)
11
12
12
13
MULTI_SELECT_TOOLTIP_MESSAGE = _ ('Hold down “Control”, or “Command” on a Mac, to select more than one.' )
@@ -26,7 +27,7 @@ class SignalFilterForm(forms.ModelForm):
26
27
)
27
28
search = forms .CharField (min_length = 3 )
28
29
pathogen = forms .ModelChoiceField (queryset = Pathogen .objects .all (), empty_label = '---------' )
29
- active = forms .NullBooleanField ( initial = None )
30
+ active = forms .TypedMultipleChoiceField ( choices = ActiveChoices , coerce = bool , widget = forms . CheckboxSelectMultiple () )
30
31
format_type = forms .ChoiceField (choices = [('' , '---------' )] + FormatChoices .choices )
31
32
source = forms .ModelChoiceField (queryset = SourceSubdivision .objects .all (), empty_label = '---------' )
32
33
time_label = forms .ChoiceField (choices = [('' , '---------' )] + TimeLabelChoices .choices , label = _ ('Temporal Resolution' ))
@@ -54,28 +55,11 @@ class Meta:
54
55
}),
55
56
'search' : forms .TextInput (attrs = {'class' : 'form-control' , 'placeholder' : 'Enter search term' }),
56
57
'pathogen' : forms .Select (attrs = {'class' : 'form-select' }),
57
- 'active' : forms .NullBooleanSelect (attrs = {'class' : 'form-check mt-3' , 'label' : "Test <i class='ri-stack-line'></i>" },),
58
- 'available_geography' : forms .CheckboxSelectMultiple (attrs = {
59
- 'class' : 'form-select' ,
60
- 'data-bs-toggle' : 'tooltip' ,
61
- 'data-bs-placement' : 'bottom' ,
62
- }),
63
- 'signal_type' : forms .CheckboxSelectMultiple (attrs = {
64
- 'class' : 'form-select' ,
65
- 'data-bs-toggle' : 'tooltip' ,
66
- 'data-bs-placement' : 'bottom' ,
67
- }),
68
- 'category' : forms .CheckboxSelectMultiple (attrs = {
69
- 'class' : 'form-select' ,
70
- 'data-bs-toggle' : 'tooltip' ,
71
- 'data-bs-placement' : 'bottom' ,
72
- }),
58
+ 'available_geography' : forms .CheckboxSelectMultiple (),
59
+ 'signal_type' : forms .CheckboxSelectMultiple (),
60
+ 'category' : forms .CheckboxSelectMultiple (),
73
61
'format_type' : forms .Select (attrs = {'class' : 'form-control' }),
74
- 'source' : forms .CheckboxSelectMultiple (attrs = {
75
- 'class' : 'form-select' ,
76
- 'data-bs-toggle' : 'tooltip' ,
77
- 'data-bs-placement' : 'bottom' ,
78
- }),
62
+ 'source' : forms .CheckboxSelectMultiple (),
79
63
'time_label' : forms .Select (attrs = {'class' : 'form-select' }),
80
64
}
81
65
0 commit comments