# Path: dju_common/forms/helpers.py
# def add_css_class_to_fields_widget(form_fields, css_class, widget_types=DEFAULT_VISIBLE_WIDGETS):
#     for k in form_fields:
#         if isinstance(form_fields[k].widget, widget_types):
#             add_css_class_to_field(form_fields[k], css_class)


from django import forms
from .helpers import add_css_class_to_fields_widget


BS_FORM_WIDGETS = (forms.TextInput, forms.Textarea, forms.Select, forms.FileInput)


class BootstrapForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(BootstrapForm, self).__init__(*args, **kwargs)
        add_css_class_to_fields_widget(self.fields, 'form-control')


class BootstrapModelForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(BootstrapModelForm, self).__init__(*args, **kwargs)

# Path: dju_common/forms/helpers.py
# def add_css_class_to_fields_widget(form_fields, css_class, widget_types=DEFAULT_VISIBLE_WIDGETS):
#     for k in form_fields:
#         if isinstance(form_fields[k].widget, widget_types):
#             add_css_class_to_field(form_fields[k], css_class)


# Path: dju_common/forms/bootstrap.py
from django import forms
from .helpers import add_css_class_to_fields_widget



BS_FORM_WIDGETS = (forms.TextInput, forms.Textarea, forms.Select, forms.FileInput)


class BootstrapForm(forms.Form):
    def __init__(self, *args, **kwargs):
        super(BootstrapForm, self).__init__(*args, **kwargs)
        add_css_class_to_fields_widget(self.fields, 'form-control')


class BootstrapModelForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(BootstrapModelForm, self).__init__(*args, **kwargs)

        add_css_class_to_fields_widget(self.fields, 'form-control')