from dbsynce.models import Resource
from webservice_running.models import ResourceLocal
from django import forms


class ResourceLocalForm(forms.ModelForm):
    def __init__(self, *args, **kwargs):
        super(ResourceLocalForm, self).__init__(*args, **kwargs)
        # Добавляем класс .form-control для всех полей формы
        for field in iter(self.fields):
            if 'class' not in self.fields[field].widget.attrs:
                self.fields[field].widget.attrs.update({'class': 'form-control'})

    class Meta:
        model = ResourceLocal
        fields = [
            'local_data'
        ]

