-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforms.py
22 lines (17 loc) · 813 Bytes
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from django import forms
from django_events_timetable.models import Event, TimeTable
class EventAdminForm(forms.ModelForm):
primary_color = forms.CharField(widget=forms.TextInput(attrs={'type': 'color'}))
background_color = forms.CharField(widget=forms.TextInput(attrs={'type': 'color'}))
text_color = forms.CharField(widget=forms.TextInput(attrs={'type': 'color'}))
class Meta:
model = Event
fields = '__all__'
class Media:
js = ('django_events_timetable/js/event_admin.js',)
class TimeTableAdminForm(forms.ModelForm):
start_time = forms.TimeField(widget=forms.TimeInput(attrs={'type': 'time'}))
end_time = forms.TimeField(widget=forms.TimeInput(attrs={'type': 'time'}), required=False)
class Meta:
model = TimeTable
fields = '__all__'