Add autofocus to firstname field
This commit is contained in:
@@ -38,6 +38,11 @@ class RentalCreateForm(forms.ModelForm):
|
|||||||
"date_end": DateInput(format=("%Y-%m-%d")),
|
"date_end": DateInput(format=("%Y-%m-%d")),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs) # to get the self.fields set
|
||||||
|
|
||||||
|
self.fields["firstname"].autofocus = True
|
||||||
|
|
||||||
|
|
||||||
class RentalAdminForm(forms.ModelForm):
|
class RentalAdminForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user