from django import forms class FaqQuestionForm(forms.Form): name = forms.CharField( label="Имя", max_length=150, widget=forms.TextInput(attrs={"placeholder": "Имя", "autocomplete": "name"}), ) phone = forms.CharField( label="Номер телефона", max_length=64, widget=forms.TextInput(attrs={"placeholder": "Номер телефона", "autocomplete": "tel"}), ) question = forms.CharField( label="Ваш вопрос", max_length=1000, widget=forms.Textarea(attrs={"placeholder": "Ваш вопрос", "rows": 4, "autocomplete": "off"}), ) accept = forms.BooleanField( label="Я согласен с политикой обработки персональных данных", error_messages={"required": "Необходимо согласие на обработку персональных данных."}, ) def clean_name(self): return self.cleaned_data["name"].strip() def clean_phone(self): return self.cleaned_data["phone"].strip() def clean_question(self): return self.cleaned_data["question"].strip()