Почистил коменты
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user