summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures/forms.py')
-rw-r--r--ishtar/furnitures/forms.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py
index 77e2c9b7e..3d663d089 100644
--- a/ishtar/furnitures/forms.py
+++ b/ishtar/furnitures/forms.py
@@ -70,6 +70,15 @@ regexp_name = re.compile(r'^[\w\- ]+$', re.UNICODE)
name_validator = validators.RegexValidator(regexp_name,
_(u"Enter a valid name consisting of letters, spaces and hyphens."), 'invalid')
+class FloatField(forms.FloatField):
+ """
+ Allow the use of comma for separating float fields
+ """
+ def clean(self, value):
+ if value:
+ value = value.replace(',', '.').replace('%', '')
+ return super(FloatField, self).clean(value)
+
class FinalForm(forms.Form):
final = True
form_label = _("Confirm")