check boxes not radio for new terms
@@ -278,15 +278,9 @@ class GroundWaterFlowForm(ModelForm):
(('Choose a package', 'Choose a package'),) + GroundWaterFlow.flowPackageChoices
flow_parameter_choices = \
(('Choose a parameter', 'Choose a parameter'),) + GroundWaterFlow.flowParameterChoices
- unsaturatedZonePackage = forms.TypedChoiceField(
- choices=((True, 'Yes'), (False, 'No')),
- widget=forms.RadioSelect(attrs={'style': 'width:auto;margin-top:-5px'}))
- horizontalFlowBarrierPackage = forms.TypedChoiceField(
- choices=((True, 'Yes'), (False, 'No')),
- widget=forms.RadioSelect(attrs={'style': 'width:auto;margin-top:-5px'}))
- seawaterIntrusionPackage = forms.TypedChoiceField(
- choices=((True, 'Yes'), (False, 'No')),
- widget=forms.RadioSelect(attrs={'style': 'width:auto;margin-top:-5px'}))
+ unsaturatedZonePackage = forms.BooleanField()
+ horizontalFlowBarrierPackage = forms.BooleanField()
+ seawaterIntrusionPackage = forms.BooleanField()
def __init__(self, allow_edit=True, res_short_id=None, element_id=None, *args, **kwargs):
super(GroundWaterFlowForm, self).__init__(*args, **kwargs)
@@ -307,32 +301,11 @@ class GroundWaterFlowForm(ModelForm):
class GroundWaterFlowValidationForm(forms.Form):
flowPackage = forms.CharField(max_length=100, required=False)
- unsaturatedZonePackage = forms.TypedChoiceField(choices=((True, 'Yes'), (False, 'No')))
- horizontalFlowBarrierPackage = forms.TypedChoiceField(choices=((True, 'Yes'), (False, 'No')))
- seawaterIntrusionPackage = forms.TypedChoiceField(choices=((True, 'Yes'), (False, 'No')))
+ unsaturatedZonePackage = forms.BooleanField(required=False)
+ horizontalFlowBarrierPackage = forms.BooleanField(required=False)
+ seawaterIntrusionPackage = forms.BooleanField(required=False)
flowParameter = forms.CharField(max_length=100, required=False)
- def cleanUnsaturatedZonePackage(self):
- data = self.cleaned_data['unsaturatedZonePackage']
- if data == u'False':
- return False
- else:
- return True
-
- def cleanHorizontalFlowBarrierPackage(self):
- data = self.cleaned_data['horizontalFlowBarrierPackage']
- if data == u'False':
- return False
- else:
- return True
-
- def cleanSeawaterIntrusionPackage(self):
- data = self.cleaned_data['seawaterIntrusionPackage']
- if data == u'False':
- return False
- else:
- return True
-
# BoundaryCondition element forms
class BoundaryConditionFormHelper(BaseFormHelper):
