try localizing number inputs
This commit is contained in:
parent
93db15b740
commit
fc7eccb06c
@ -96,6 +96,22 @@ class BaseCaseStudyForm(forms.models.ModelForm):
|
||||
self.helper.field_class = 'col-md-9'
|
||||
self.helper.include_media = False
|
||||
|
||||
# Parse number fields correctly for the locale
|
||||
number_fields = [
|
||||
"area_of_land",
|
||||
"total_generation_capacity",
|
||||
"total_investment",
|
||||
"energy_storage_capacity",
|
||||
"energy_transmission_capacity",
|
||||
"area_of_land",
|
||||
"total_generation_capacity",
|
||||
"total_investment",
|
||||
]
|
||||
|
||||
for field_name in number_fields:
|
||||
if field_name in self.fields:
|
||||
self.fields[field_name].localize = True
|
||||
|
||||
class Meta:
|
||||
model = CaseStudy
|
||||
fields = '__all__'
|
||||
|
Loading…
Reference in New Issue
Block a user