forms.py 720 B

123456789101112131415161718
  1. import datetime
  2. from django import forms
  3. from .widgets import DatePickerWidget
  4. class CreateEventForm(forms.Form):
  5. event_name = forms.CharField(label='Event name', max_length=100)
  6. event_date = forms.Field(label='Event date', widget=DatePickerWidget)
  7. start_time = forms.TimeField(label='Start time', initial=datetime.time(9, 0))
  8. end_time = forms.TimeField(label='End time', initial=datetime.time(20, 0))
  9. class LoginForm(forms.Form):
  10. username = forms.CharField(label='Username', max_length=100)
  11. password = forms.CharField(label='Password', max_length=100, widget=forms.PasswordInput, required=False)
  12. class UpdateSlotsForm(forms.Form):
  13. slots = forms.CharField(label='Slots', max_length=100)