Exemplo n.º 1
0
 class Meta:
     model = Entry
     fields = (
         'customer',
         'date',
         'time',
         'treatment',
         'duration',
         'resource',
         'notes',
     )
     widgets = {
         # override customer widget attributes AFTER creating the form
         'customer': RelatedFieldWidgetCanAdd(Customer),
         'date': DateWidget(
             bootstrap_version=3,
             options=DATE_WIDGET_OPTIONS,
         ),
         'time': TimeWidget(
             bootstrap_version=3,
             options=TIME_WIDGET_OPTIONS,
         ),
         'duration': TimeWidget(
             bootstrap_version=3,
             options=DURATION_WIDGET_OPTIONS,
         ),
     }
     input_formats = {
         'time': TIME_FORMATS,
         'duration': DURATION_FORMATS,
     }
Exemplo n.º 2
0
class AppliedReserveAirspaceUpdateForm(forms.ModelForm):
    class Meta:
        model = ReserveAirspace
        fields = (
            'rpas',
            'start_day',
            'start_time',
            'end',
            'geom',
            'log',
        )
        widgets = {
            'geom': LeafletWidget(),
            'start_day': widgets.SelectDateWidget(),
            # 'rpas': forms.widgets.Select(attrs={'readonly': True,
            #                                       'disabled': True})
        }

    start_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))

    end = forms.TimeField(widget=TimeWidget(usel10n=True, bootstrap_version=3))

    def __init__(self, *args, **kwargs):
        user = kwargs.pop('user', None)
        super(AppliedReserveAirspaceUpdateForm, self).__init__(*args, **kwargs)
        org = user.userprofile.organization
        self.fields['rpas'] = forms.ModelChoiceField(
            queryset=Rpas.objects.filter(organization=org).order_by('-id'))
Exemplo n.º 3
0
class reservaForm(forms.Form):
    motel = forms.CharField(label="Motel:",widget=forms.TextInput(attrs={'class' : 'form-control'}))
    pieza = forms.CharField(label="Pieza",widget=forms.TextInput(attrs={'class' : 'form-control'}))
    fecha1 = forms.DateField(label="Fecha de Inicio:",widget=DateWidget(usel10n=True, bootstrap_version=3))
    hora1 = forms.TimeField(label="Hora de Inicio:",widget=TimeWidget(usel10n=True, bootstrap_version=3))
    fecha2 = forms.DateField(label="Fecha de Término:",widget=DateWidget(usel10n=True, bootstrap_version=3))
    hora2 = forms.TimeField(label="Hora de Término:",widget=TimeWidget(usel10n=True, bootstrap_version=3))
Exemplo n.º 4
0
class DataAveragesForm(forms.Form):
    week_day = forms.MultipleChoiceField(choices=weekDays, required=False)
    start_date = forms.DateField(
        widget=DateWidget(usel10n=True, bootstrap_version=3))
    end_date = forms.DateField(
        widget=DateWidget(usel10n=True, bootstrap_version=3))
    start_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
    end_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
    geo_type = forms.ChoiceField(required=True)
Exemplo n.º 5
0
 class Meta:
     model = Training
     fields = [
         'date', 'start', 'end', 'location', 'exercises', 'team_plays',
         'team'
     ]
     widgets = {
         'date': DateWidget(usel10n=True, bootstrap_version=3),
         'start': TimeWidget(usel10n=True, bootstrap_version=3),
         'end': TimeWidget(usel10n=True, bootstrap_version=3),
     }
Exemplo n.º 6
0
class CreateEventForm1(forms.Form):
    date = forms.DateField(widget=DateWidget(usel10n=True,
                                             bootstrap_version=4),
                           input_formats=DATE_INPUT_FORMAT,
                           help_text="Event date")
    start_time = forms.TimeField(widget=TimeWidget(usel10n=True,
                                                   bootstrap_version=4),
                                 input_formats=TIME_INPUT_FORMAT,
                                 help_text="Start time")
    end_time = forms.TimeField(widget=TimeWidget(usel10n=True,
                                                 bootstrap_version=4),
                               input_formats=TIME_INPUT_FORMAT,
                               help_text="End time")
Exemplo n.º 7
0
Arquivo: forms.py Projeto: XYZ17/MRBS
class BookingForm(forms.Form):
    TodayDate = datetime.datetime.now().date()
    DateOptions = {
        'format': 'yyyy-mm-dd',
        'startDate': TodayDate.strftime("%Y-%m-%d"),
        'todayHighlight': True,
        'pickerPosition': "bottom-left"
    }
    EndDateOptions = {
        'format': 'yyyy-mm-dd',
        'startDate': TodayDate.strftime("%Y-%m-%d")
    }
    TimeOptions = {
        'format': 'HH:ii P',
        'startDate': '9999-12-31 07:00',
        'showMeridian': True,
        'minuteStep': 10
    }
    prefer_date = forms.DateField(widget=DateWidget(bootstrap_version=3,
                                                    options=DateOptions),
                                  initial=datetime.date.today())
    end_date = forms.DateField(
        widget=DateWidget(bootstrap_version=3, options=EndDateOptions))
    start_time = forms.TimeField(
        widget=TimeWidget(bootstrap_version=3, options=TimeOptions))
    end_time = forms.TimeField(
        widget=TimeWidget(bootstrap_version=3, options=TimeOptions))
    title = forms.CharField(widget=forms.TextInput(
        attrs={'class': 'form-control'}))
    choice_list = range(1, 41)
    choice_list = ["---------"] + choice_list
    no_of_attendees = forms.ChoiceField(
        choices=[(i, i) for i in choice_list],
        widget=forms.Select(attrs={'class': 'form-control'}))
    #attendees = forms.CharField(widget=forms.Textarea(attrs={'class':'form-control','rows': "1"}),required=False)
    attendees = forms.CharField(widget=autocomplete.Select2Multiple(
        url='user-autocomplete', forward=['attendees']),
                                required=False)
    involves = forms.ChoiceField(widget=forms.RadioSelect(),
                                 choices=[('Internal', 'Internal Only'),
                                          ('External', 'External')])
    equipments = forms.MultipleChoiceField(widget=CheckboxSelectMultiple(),
                                           choices=[
                                               ('Video', 'Video Conference'),
                                               ('Computer', 'Computer Usage'),
                                               ('Phone', 'Phone Conference')
                                           ],
                                           required=False)
    highly_confidential = forms.ChoiceField(
        choices=[('No', 'No'), ('Yes', 'Yes')],
        widget=forms.Select(attrs={'class': 'form-control'}))
Exemplo n.º 8
0
class NotamCreateForm(forms.ModelForm):
    start_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
    end = forms.TimeField(widget=TimeWidget(usel10n=True, bootstrap_version=3))

    class Meta:
        model = NotamAirspace

        fields = ('reason', 'start_day', 'start_time', 'end', 'geom',
                  'notam_file')
        widgets = {
            'geom': ExtLeafletWidget(),
            'start_day': widgets.SelectDateWidget(),
        }
Exemplo n.º 9
0
class DataValuesForm(forms.Form):
    users = forms.MultipleChoiceField(choices=[], required=True)
    all_users = forms.BooleanField(required=False)
    week_day = forms.MultipleChoiceField(choices=weekDays, required=False)
    start_date = forms.DateField(
        widget=DateWidget(usel10n=True, bootstrap_version=3))
    end_date = forms.DateField(
        widget=DateWidget(usel10n=True, bootstrap_version=3))
    start_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
    end_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
    pm_level = forms.ChoiceField(choices=[], required=False)
    geo_type = forms.ChoiceField(required=False)
    geo_boundaries = forms.MultipleChoiceField(choices=[], required=False)
Exemplo n.º 10
0
def make_custom_datetimefield(f):
    formfield = f.formfield()
    datetime_options = {
        # 'format': 'dd-mm-yyyy HH:ii P',
        'showMeridian': True,
        'todayHighlight': True,
        'minuteStep': 15,
        'pickerPosition': 'bottom-left',
        # 'minView': '1',
    }

    if isinstance(f, models.DateTimeField):
        formfield.widget = DateTimeWidget(usel10n=True,
                                          options=datetime_options,
                                          bootstrap_version=3)
    elif isinstance(f, models.DateField):
        formfield.widget = DateWidget(usel10n=True,
                                      options=datetime_options,
                                      bootstrap_version=3)
    elif isinstance(f, models.TimeField):
        formfield.widget = TimeWidget(usel10n=True,
                                      options=datetime_options,
                                      bootstrap_version=3)
    elif isinstance(f, models.TextField):
        formfield.widget = SummernoteWidget()

    return formfield
Exemplo n.º 11
0
    class Meta:
        model = Appointment

        widgets = {
            'existing_client':
            forms.RadioSelect(renderer=HorizontalRadioRenderer,
                              choices=((1, "Yes"), (0, "No"))),
            'appointment_date':
            DateWidget(attrs={'id': "yourdateid"},
                       usel10n=True,
                       bootstrap_version=3),
            'appointment_time':
            TimeWidget(attrs={'id': "yourtimeid"},
                       usel10n=True,
                       bootstrap_version=3)
        }
        fields = (
            'existing_client',
            'caller_first_name',
            'caller_last_name',
            'type_of_appointment',
            'further_appointment_notes',
            'phone_number',
            'appointment_date',
            'appointment_time',
        )
Exemplo n.º 12
0
class testFormBootstrap2(forms.Form):
    date_time = forms.DateTimeField(
        widget=DateTimeWidget(usel10n=True, bootstrap_version=2))
    date = forms.DateField(
        widget=DateWidget(usel10n=True, bootstrap_version=2))
    time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=2))
Exemplo n.º 13
0
    def get_context_data(self, **kwargs):

        # Call the base implementation first to get a context
        context = super().get_context_data(**kwargs)
        # Add in a QuerySet of all the books
        context['formset_products'] = self.ProductFormset(
            queryset=DealProducts.objects.filter(deal=self.kwargs['pk']),
            prefix='products')
        context['formset_status'] = self.StatusFormset(
            queryset=DealStatus.objects.filter(deal=self.kwargs['pk']),
            prefix='status')
        # We must set uniq id for each datetime picker in each form
        for i, f in enumerate(context['formset_status']):
            std = 'yourdateid' + str(i)
            stt = 'yourtimeid' + str(i)
            f.fields['deal_data'].widget = DateWidget(attrs={'id': std},
                                                      usel10n=True,
                                                      bootstrap_version=3)
            f.fields['deal_time'].widget = TimeWidget(attrs={'id': stt},
                                                      usel10n=True,
                                                      bootstrap_version=3)

        # Patch for initial data for readonly field
        try:
            # If form has errors self.req will undefined and we must handled it
            user = User.objects.get(username=self.req.user)

            if not user.groups.filter(name='boss').exists():
                sales_person = SalesPerson.objects.get(user=user)
                context['form'].fields['sales_person'].initial = sales_person
        except:
            pass

        return context
Exemplo n.º 14
0
def make_custom_datetimefield(f):
    formfield = f.formfield()
    dateTimeOptions = {
        'showMeridian': False,
        # 'todayBtn': True,
        'todayHighlight': True,
        'minuteStep': 5,
        'pickerPosition': 'bottom-left',
    }

    if isinstance(f, models.DateTimeField):
        formfield.widget = DateTimeWidget(usel10n=True,
                                          options=dateTimeOptions,
                                          bootstrap_version=3)
    elif isinstance(f, models.DateField):
        formfield.widget = DateWidget(usel10n=True,
                                      options=dateTimeOptions,
                                      bootstrap_version=3)
        # formfield.widget = SelectDateWidget()
    elif isinstance(f, models.TimeField):
        formfield.widget = TimeWidget(usel10n=True,
                                      options=dateTimeOptions,
                                      bootstrap_version=3)

    return formfield
Exemplo n.º 15
0
class FoodRecordForm(forms.ModelForm):
    categorie = forms.ChoiceField(choices=CATEGORIES)
    eenheid = forms.ModelChoiceField(
        queryset=Measurement.objects.all().order_by('amount'),
        widget=autocomplete.ModelSelect2(url='measurement-autocomplete', forward=['display_name'])
    )
    koppel_eenheid_aan_alle_producten_binnen_deze_categorie = forms.BooleanField(required=False)
    aantal_eenheden = forms.FloatField()
    datum = forms.DateField(
        widget=DateWidget(attrs={'id': "id_datum", "autocomplete": "off"}, usel10n=True, bootstrap_version=3)
    )
    tijd = forms.TimeField(
        widget=TimeWidget(attrs={'id': "id_tijd", "autocomplete": "off"}, usel10n=False, bootstrap_version=3, options={'format': 'hh:ii'})
    )
    class Meta:
        model = FoodRecord
        fields = ['patient_id', 'datum', 'tijd', 'missing_time', 'categorie', 'display_name', 'eenheid', 'koppel_eenheid_aan_alle_producten_binnen_deze_categorie', 'aantal_eenheden']
        widgets = {
            'display_name': autocomplete.ModelSelect2(url='product-autocomplete', forward=['categorie']),

        }
        labels = {'patient_id': _('Patient ID'),
                  'amount': _('Hoeveelheid (gram)'),
                  'display_name': _('Product'),
                  'missing_time': _('Tijd Onbekend')}
Exemplo n.º 16
0
	class Meta:
		model = VirtualRoomPage
		fields = [
			'name',
			'facilitator',
			'date',
			'hour_from',
			'clock',
			'online_room_url',
			'attendee_info',
		]
		date2=datetime.datetime.now().date() + datetime.timedelta(days=5*30)
		dateOptions = {
			'format': 'yyyy-mm-dd',
			'todayHighlight':True,
			'autoclose': True,
			'pickerPosition': 'bottom-left',
			'startDate': datetime.datetime.now().date().isoformat(),
			'endDate': date2.isoformat()
			}
		timeOptions = {
			'format': 'hh:ii',
			'autoclose': True,
			'minuteStep': 30,
			'pickerPosition': 'bottom-left',
			}


		widgets = {
			'date': DateWidget(options=dateOptions, usel10n=True, bootstrap_version=3),
			'hour_from': TimeWidget(options=timeOptions,  usel10n=True, bootstrap_version=3),
		}
Exemplo n.º 17
0
class CAAAppliedReserveAirspaceUpdateForm(forms.ModelForm):
    class Meta:
        model = ReserveAirspace
        fields = ('start_day', 'start_time', 'end', 'geom', 'status', 'reason',
                  'comments')
        widgets = {
            'geom': LeafletWidget(),
            'start_day': widgets.SelectDateWidget(),
            # 'rpas': forms.widgets.Select(attrs={'readonly': True,
            #                                       'disabled': True})
        }

    start_time = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))

    end = forms.TimeField(widget=TimeWidget(usel10n=True, bootstrap_version=3))
Exemplo n.º 18
0
    def clean_book_date(self):
        book_date = self.cleaned_data[
            'book_date']  #to check if date is in past
        if book_date < datetime.date.today():
            raise forms.ValidationError("The date cannot be in the past!")
        return book_date

        time_start = forms.TimeField(widget=TimeWidget(
            usel10n=True,
            bootstrap_version=3))  #widget inside this is not necessary
Exemplo n.º 19
0
class GrupoForm(forms.ModelForm):
    horainicio = forms.TimeField(label='Hora inicio',
                                 required=True,
                                 widget=TimeWidget())

    horafin = forms.CharField(label='Hora fin',
                              required=True,
                              widget=TimeWidget())

    aula = forms.ModelChoiceField(required=True,
                                  queryset=Aula.objects.all(),
                                  label='Aula',
                                  widget=ModelSelect2Widget(
                                      queryset=Aula.objects.order_by('id'),
                                      search_fields=['descripcion__icontains'],
                                      max_results=5))

    dia = forms.ModelChoiceField(required=True,
                                 queryset=Dia.objects.all(),
                                 label='Dias',
                                 widget=ModelSelect2Widget(
                                     queryset=Dia.objects.order_by('id'),
                                     search_fields=[
                                         'dia1__icontains', 'dia2__icontains',
                                         'dia3__icontains'
                                     ],
                                     max_results=5))

    subnivel = forms.ModelChoiceField(required=True,
                                      queryset=SubNivel.objects.all(),
                                      label='Subnivel',
                                      widget=SubnivelWidget())

    def __init__(self, *args, **kwargs):
        super(GrupoForm, self).__init__(*args, **kwargs)
        for i, (fname, field) in enumerate(self.fields.iteritems()):
            field.widget.attrs['class'] = field.widget.attrs.get(
                'class', '') + ' form-control'

    class Meta:
        model = Grupo
        fields = ['horainicio', 'horafin', 'aula', 'dia', 'subnivel']
Exemplo n.º 20
0
class EventForm(forms.Form):
    eventtype = forms.CharField(required=False,label='Title', widget=forms.TextInput(attrs={'placeholder': 'Title of event'}))
    snap = forms.FileField(required=False,label='Event Look-up Picture ')    
    date_event = forms.DateTimeField(label='Event Date',widget=DateTimeWidget(usel10n=True, bootstrap_version=3))    
    description = forms.CharField(label='Description', widget=forms.TextInput(attrs={'placeholder': 'Give some overview of your event'}))
    place = forms.CharField(
        label='Place', widget=forms.TextInput(attrs={'placeholder': 'Location of your event offer '})
    )    
    duration = forms.TimeField(widget=TimeWidget(usel10n=True, bootstrap_version=3))
    dresscode = forms.BooleanField(
        label='Event Dress Code Allow'
    )  
Exemplo n.º 21
0
class RegistrationScheduleForm(forms.Form):
    dateTimeOptions = {
        'format': 'yyyy-mm-dd',
        'autoclose': True,
        'showMeridian': True
    }
    hora = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
    fecha = forms.DateField(widget=DateWidget(attrs={'id': "yourdatetimeid"},
                                              bootstrap_version=3,
                                              options=dateTimeOptions),
                            label="Fecha de nacimiento",
                            required=True)
Exemplo n.º 22
0
 class Meta:
     model = DealStatus
     fields = '__all__'
     widgets = {
         'deal_data':
         DateWidget(attrs={'id': "yourdateid"},
                    usel10n=True,
                    bootstrap_version=3),
         'deal_time':
         TimeWidget(attrs={'id': "yourtimeid"},
                    usel10n=True,
                    bootstrap_version=3)
     }
Exemplo n.º 23
0
class EventForm(forms.Form):
    eventtype = forms.CharField(required=False,
                                label='Enter your Event Title name')
    snap = forms.FileField(required=False,
                           label='Give the Event Look-up Picture ')

    date_event = forms.DateTimeField(
        widget=DateTimeWidget(usel10n=True, bootstrap_version=3))
    description = forms.CharField(label='Enter Event Description')
    place = forms.CharField(label='Enter Event Place', )
    dresscode = forms.BooleanField(label='Enter your Event Dress', )
    duration = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))
Exemplo n.º 24
0
 class Meta:
     model = Todo
     # В форме поля будут в том же порядке, как перечисленны ниже
     fields = '__all__'
     widgets = {
         'todo_data':
         DateWidget(attrs={'id': "yourdateid"},
                    usel10n=True,
                    bootstrap_version=3),
         'todo_time':
         TimeWidget(attrs={'id': "yourtimeid"},
                    usel10n=True,
                    bootstrap_version=3),
     }
Exemplo n.º 25
0
 class Meta:
     model = Deal
     # В форме поля будут в том же порядке, как перечисленны ниже
     fields = ('sales_person', 'customer', 'ident', 'price', 'description')
     widgets = {
         'todo_data':
         DateWidget(attrs={'id': "yourdateid"},
                    usel10n=True,
                    bootstrap_version=3),
         'todo_time':
         TimeWidget(attrs={'id': "yourtimeid"},
                    usel10n=True,
                    bootstrap_version=3)
     }
Exemplo n.º 26
0
    class Meta:
        model = IncidentReport
        fields = [
            'station',
            'other_station',
            'nature_of_report',
            'date_of_incident',
            'time_of_incident',
            'location_of_incident',
            # 'specific_location',
            'name_of_party_involved',
            'organisation',
            'gender',
            'role',
            'incident_detail',
            'upload_evidence',
            'Full_Name',
            'Position_Title',
            'Phone_no',
            'email'
        ]

        labels = {'nature_of_report': _('Nature Of Report'), }
        help_texts = {
            'station':"The name of the suboffice/airport where the incident occurred",
            'nature_of_report':"Category of violation ",
            'date_of_incident': "Date on which the incident occurred",
            'time_of_incident':'Estimated time when the incident occurred',
            'location_of_incident':'the exact location where the incident occurred',
            'specific_location': "specific area where the incident happened ",
            'name_of_party_involved':'Name of person involved if known',
            'organisation':'The organisation which the person involved works for',
            'gender':"Gender of person involved",
            'role':'',
            'incident_detail':'Please include sufficient detail describing: What happened, How it happened,Why you consider it took place  ',
            'upload_evidence':'',
            'Full_Name':'',
            'Position_Title':"",
            'Phone_no':"",
            'email':"",
        }


        widgets = {

                'incident_incident': Textarea(attrs={'cols': 80, 'rows': 10}),
                'date_of_incident': DateWidget(attrs={"id": "date_of_incident"}, usel10n=True, bootstrap_version=3),
                'time_of_incident': TimeWidget(attrs={"id": "time_of_incident"}, usel10n=True, bootstrap_version=3),

            }
Exemplo n.º 27
0
 class Meta:
     model = Book_Facility
     fields = [
         'facility',
         'event',
         'book_date',
         'time_start',
         'time_end',
     ]
     widgets = {
         #Use localization and bootstrap 3
         'book_date':
         DateWidget(attrs={'id': "yourdatetimeid"},
                    usel10n=True,
                    bootstrap_version=3),
         'time_start':
         TimeWidget(attrs={'id': "yourdatetimeid"},
                    usel10n=True,
                    bootstrap_version=3),
         'time_end':
         TimeWidget(attrs={'id': "yourdatetimeid"},
                    usel10n=True,
                    bootstrap_version=3),
     }
Exemplo n.º 28
0
 class Meta:
     model = Horario
     fields = ['fecha', 'hora', 'detalle', 'estado', 'duracion']
     labels = {
         'fecha': 'Fecha',
         'hora': 'Hora',
         'detalle': 'Detalle',
         'estado': 'Estado',
         'duracion': 'Duracion(Minutos)'
     }
     widgets = {
         'fecha':
         DateWidget(attrs={
             'id': "yourdatetimeid",
             'class': u'form-control'
         },
                    usel10n=True,
                    bootstrap_version=3),
         'hora':
         TimeWidget(attrs={
             'id': "yourdatetimeid",
             'class': u'form-control'
         },
                    usel10n=True,
                    bootstrap_version=3),
         'detalle':
         Textarea(
             attrs={
                 'class': u'form-control',
                 'placeholder': u'Ingrese respuesta ...',
                 'rows': 10,
                 'cols': 40,
                 'style': 'height: 6em;'
             }),
         'estado':
         Select(attrs={'class': u'form-control'}),
         'duracion':
         NumberInput(
             attrs={
                 'class': u'form-control',
                 'placeholder': u'Minutos',
                 'min': '1',
                 'max': '120',
                 'step': '5'
             }),
     }
Exemplo n.º 29
0
 class Meta:
     model = Deal
     # В форме поля будут в том же порядке, как перечисленны ниже
     fields = ('sales_person', 'customer', 'ident', 'price', 'description')
     widgets = {
         'sales_person':
         HiddenWidget('fa fa-user fa-lg',
                      func=SalesPerson.objects.get,
                      attrs={'class': 'form-control'}),
         'todo_data':
         DateWidget(attrs={'id': "yourdateid"},
                    usel10n=True,
                    bootstrap_version=3),
         'todo_time':
         TimeWidget(attrs={'id': "yourtimeid"},
                    usel10n=True,
                    bootstrap_version=3)
     }
Exemplo n.º 30
0
class FacilityBookForm(forms.ModelForm):
    class Meta:
        model = Book_Facility
        fields = [
            'facility',
            'event',
            'book_date',
            'time_start',
            'time_end',
        ]
        widgets = {
            #Use localization and bootstrap 3
            'book_date':
            DateWidget(attrs={'id': "yourdatetimeid"},
                       usel10n=True,
                       bootstrap_version=3),
            'time_start':
            TimeWidget(attrs={'id': "yourdatetimeid"},
                       usel10n=True,
                       bootstrap_version=3),
            'time_end':
            TimeWidget(attrs={'id': "yourdatetimeid"},
                       usel10n=True,
                       bootstrap_version=3),
        }

    def clean_book_date(self):
        book_date = self.cleaned_data[
            'book_date']  #to check if date is in past
        if book_date < datetime.date.today():
            raise forms.ValidationError("The date cannot be in the past!")
        return book_date

        time_start = forms.TimeField(widget=TimeWidget(
            usel10n=True,
            bootstrap_version=3))  #widget inside this is not necessary

    time_end = forms.TimeField(
        widget=TimeWidget(usel10n=True, bootstrap_version=3))