@@ -0,0 +1,942 @@
+from django.forms import ModelForm, TextInput%0Afrom django.core.exceptions import ValidationError%0A%0Afrom .models import Clients%0A%0Afrom schwifty import IBAN%0A%0A%0Aclass ClientsForm(ModelForm):%0A    class Meta:%0A        model = Clients%0A        fields = %5B'first_name', 'last_name', 'iban', 'country'%5D%0A        widgets = %7B%0A            'first_name': TextInput(attrs=%7B'class': 'form-control'%7D),%0A            'last_name': TextInput(attrs=%7B'class': 'form-control'%7D),%0A            'iban': TextInput(attrs=%7B'class': 'form-control'%7D),%0A            'country': TextInput(attrs=%7B'class': 'form-control'%7D),%0A        %7D%0A%0A    def clean(self):%0A        super(ClientsForm, self).clean()%0A        iban = self.cleaned_data.get('iban', '')%0A%0A        try:%0A            iban = IBAN(iban)%0A        except ValueError:%0A            raise ValidationError(%0A                %22Invalid IBAN%22%0A            )%0A        self.cleaned_data%5B'country'%5D = iban.country_code%0A        return self.cleaned_data%0A

Add clients form