init
This commit is contained in:
26
instructor/forms.py
Normal file
26
instructor/forms.py
Normal file
@ -0,0 +1,26 @@
|
||||
from django import forms
|
||||
from .models import Instructor, InstructorSchedule
|
||||
|
||||
class InstructorScheduleForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = InstructorSchedule
|
||||
fields = ['day_of_week', 'start_time', 'end_time', 'is_available']
|
||||
widgets = {
|
||||
'start_time': forms.TimeInput(attrs={'type': 'time'}),
|
||||
'end_time': forms.TimeInput(attrs={'type': 'time'}),
|
||||
}
|
||||
|
||||
class InstructorProfileForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Instructor
|
||||
fields = ['experience_years', 'specialization', 'is_available']
|
||||
|
||||
class InstructorForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Instructor
|
||||
fields = ['experience_years', 'specialization', 'is_available']
|
||||
widgets = {
|
||||
'experience_years': forms.NumberInput(attrs={'class': 'form-control'}),
|
||||
'specialization': forms.TextInput(attrs={'class': 'form-control'}),
|
||||
'is_available': forms.CheckboxInput(attrs={'class': 'form-check-input'}),
|
||||
}
|
Reference in New Issue
Block a user