Почистил коменты

This commit is contained in:
2026-02-22 12:37:22 +05:00
parent f042c1669e
commit 24712588f8
5 changed files with 6 additions and 6 deletions

View File

@@ -7,7 +7,7 @@ class AutoForm(forms.ModelForm):
model = Auto
fields = ['brand', 'model', 'year', 'color']
# Настройка виджетов и стилей (опционально, но улучшает внешний вид)
# Настройка виджетов и стилей
widgets = {
'brand': forms.TextInput(attrs={
'class': 'form-control',
@@ -29,7 +29,7 @@ class AutoForm(forms.ModelForm):
}),
}
# Дополнительная валидация (опционально)
# Дополнительная валидация
def clean_year(self):
year = self.cleaned_data.get('year')
if year and (year < 1900 or year > 2100):

View File

@@ -9,7 +9,7 @@ class AutoCreateView(CreateView):
model = Auto
form_class = AutoForm
template_name = 'autoapp/add_auto.html'
success_url = reverse_lazy('auto_list') # или другая страница
success_url = reverse_lazy('auto_list')
def form_valid(self, form):
response = super().form_valid(form)