diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/forms.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 7fed8b1c2..26da204fd 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -115,7 +115,7 @@ JSON_VALUE_TYPES_FIELDS = { 'T': (forms.CharField, None), 'LT': (forms.CharField, forms.Textarea), 'I': (forms.IntegerField, None), - 'F': (forms.FloatField, None), + 'F': (FloatField, None), 'D': (DateField, None), 'B': (forms.NullBooleanField, None), 'C': (widgets.Select2DynamicField, None), @@ -240,10 +240,14 @@ class CustomForm(object): if field.help_text: attrs['help_text'] = field.help_text if widget: - attrs['widget'] = widget(attrs={"class": "form-control"}) + attrs['widget'] = widget() if field_cls == widgets.Select2DynamicField: attrs['choices'] = cls._get_dynamic_choices(key) f = field_cls(**attrs) + kls = 'form-control' + if 'class' in f.widget.attrs: + kls = f.widget.attrs['class'] + " " + kls + f.widget.attrs['class'] = kls fields.append((field.order or 1, key, f)) return fields |