class Meta: model = TimingDigitalMedia fields = ('time_stamp', 'end_time_stamp', 'number_of_timestamp', 'text_for_time_stamp', 'timestamp_for_dm') widgets = { 'time_stamp': TimeInput(attrs={ 'class': 'form-control', 'placeholder': 'Начало фрагмента' }), 'end_time_stamp': TimeInput(attrs={ 'class': 'form-control', 'placeholder': 'Конец фрагмента' }), 'number_of_timestamp': NumberInput(attrs={'class': 'form-control'}), 'timestamp_for_dm': Select(attrs={ # 'disabled': True, 'class': 'form-control visually-hidden' }), 'text_for_time_stamp': TextInput(attrs={ 'class': 'form-control', 'placeholder': 'Описание' }) }
class Meta: model = DefaultTrip fields = ('morning_departure_time', 'morning_arriving_time', 'evening_departure_time', 'has_for_start', 'deactivate', 'user_is_driver') widgets = { 'morning_departure_time': TimeInput(attrs={ 'type': 'time', 'class': 'form-control require-input' }), 'morning_arriving_time': TimeInput(attrs={ 'type': 'time', 'class': 'form-control require-input' }), 'evening_departure_time': TimeInput(attrs={ 'type': 'time', 'class': 'form-control require-input' }), 'deactivate': CheckboxInput( attrs={ 'class': 'toggle_button_deactivate_day', '@click': 'deactivate_fields($event.target)' }), 'user_is_driver': CheckboxInput(attrs={'class': 'toggle_button_driver'}), }
class Meta: model = Aulas fields = ['dia', 'horario', 'duracao', 'disciplina', 'conteudo'] widgets = { 'dia': TextInput(attrs={ 'class': 'form-control', 'placeholder': 'Dia da aula' }), 'horario': TimeInput(attrs={ 'class': 'form-control', 'placeholder': 'Horario da aula' }), 'duracao': TimeInput(attrs={ 'class': 'form-control', 'placeholder': 'Duração da aula' }), 'disciplina': TextInput( attrs={ 'class': 'form-control', 'placeholder': 'Disciplina ministrada na aula' }), 'conteudo': TextInput(attrs={ 'class': 'form-control', 'placeholder': 'Conteudo da aula' }) }
class Meta: model = Event widgets = { 'day': DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'), 'start_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), 'end_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } fields = '__all__'
class Meta: model = Event widgets = { 'day': DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'), 'start_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), 'end_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } fields = ('eventtitle', 'day', 'start_time', 'end_time', 'notes')
class Meta: model = Timesheet fields = ['name', 'date', 'start', 'end', 'task_done'] widgets = { 'date': DateInput(), 'start': TimeInput(), 'end': TimeInput() }
class Meta: model = DefaultTrip fields =('morning_departure_time', 'morning_arriving_time', 'evening_departure_time','has_for_start', 'deactivate' ) widgets = { 'morning_departure_time': TimeInput(attrs={'type': 'time', 'class': 'form-control require-input'}), 'morning_arriving_time': TimeInput(attrs={'type': 'time', 'class': 'form-control require-input'}), 'evening_departure_time': TimeInput(attrs={'type': 'time', 'class': 'form-control require-input'}), 'deactivate': CheckboxInput(attrs={'type': 'checkbox', 'class': 'form-control require-input'}), }
class Meta: model = Activity fields = ['content', 'day', 'fromTime','toTime'] widgets={ "fromTime":TimeInput(attrs={'type':'time','class':'tb-input'}), "toTime":TimeInput(attrs={'type':'time', 'class':'tb-input'}), "content":TimeInput(attrs={'class':'tb-input', 'placeholder':'할 일'}), }
class Meta: model = EventCita # datetime-local is a HTML5 input type, format to make date time show on fields widgets = { 'start_time': DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'), 'date_start_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), 'date_end_time': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } fields = '__all__'
class Meta: model = EventModel fields = ('name', 'description', 'price', 'serves_type', 'is_child', 'is_parent', 'is_adult', 'image', 'date', 'start_time', 'end_time') widgets = { 'date': DateInput(), 'start_time': TimeInput(), 'end_time': TimeInput() }
class Meta: model = Timesheet fields = [ 'name', 'description', 'refer_client', 'refer_project', 'refer_task', 'users', 'tags', 'date', 'start', 'end', 'task_done' ] widgets = { 'date': DateInput(), 'start': TimeInput(), 'end': TimeInput() }
class Meta: model = Shift exclude = ('project', 'all_day') widgets = { 'start': TimeInput(attrs={'type': 'time', 'class': 'timepicker'}), 'end': TimeInput(attrs={'type': 'time', 'class': 'timepicker'}), 'date': DateInput(attrs={'type': 'date', 'class': 'datepicker'}), }
class Meta: model = Company fields = ['name', 'description', 'company_type', 'image', 'working_hour_from', 'working_hour_to'] widgets = { 'name': TextInput(attrs={'class': 'form-control'}), 'description': Textarea(attrs={'class': 'form-control'}), 'company_type': Select(attrs={'class': 'form-control custom-select'}), 'image': FileInput(attrs={'class': 'form-control'}), 'working_hour_from': TimeInput({'class': 'form-control', 'type': 'time'}), 'working_hour_to': TimeInput({'class': 'form-control', 'type': 'time'}) }
class Meta: model = Appointment widgets = { 'date': DateInput(format='%Y-%m-%d', attrs={'type': 'date'}), 'start_time': TimeInput(attrs={'type': 'time'}), 'end_time': TimeInput(attrs={'type': 'time'}), 'private': CheckboxInput(), } fields = [ 'title', 'date', 'start_time', 'end_time', 'comment', 'private' ]
class Meta: model = SubmitReport exclude = ['summary', 'status'] widgets = { 'start_time': TimeInput(), 'end_time': TimeInput(), 'start_date': DateInput(attrs={'class': 'datepicker'}), 'end_date': DateInput(attrs={'class': 'datepicker'}), 'courses': FilteredSelectMultiple(("Courses"), False), 'service_type': RadioSelect(), }
class Meta: model = SubmitReport exclude= ['submitter', 'status', 'first_name', 'last_name'] widgets = { 'summary': Textarea(attrs={'cols': 50, 'rows': 3}), 'service_type': RadioSelect(), 'courses': CheckboxSelectMultiple(), 'start_time': TimeInput(), 'end_time': TimeInput(), 'start_date': DateInput(attrs={'class': 'datepicker'}), 'end_date': DateInput(attrs={'class': 'datepicker'}), }
class Meta: model = Events exclude = ['organizer', 'players', 'address', 'number_street'] widgets = { 'rules': Textarea(attrs={ 'cols': 30, 'rows': 10 }), 'date_event': DateInput(), 'time_event': TimeInput(), 'duration': TimeInput(), }
class Meta: model = Event widgets = { 'start_date': DateInput(attrs={'type': 'date'}), 'end_date': DateInput(attrs={'type': 'date'}), 'start_hm': TimeInput(attrs={'type': 'time'}, format='%H:%M'), 'end_hm': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } exclude = ['start_time', 'end_time', 'user'] labels = { 'start_hm': ('Start time'), 'end_hm': ('End time'), }
class Meta: model = Dates fields = [ "title", "description", "agent", "date_start_time", "time_start_time", "date_end_time", "time_end_time" ] widgets = { "title": TextInput(attrs={ "class": "form-control", 'placeholder': 'Titulo', }), "description": Textarea(attrs={ "class": "form-control", 'placeholder': 'Descripcion', }), "agent": Select(attrs={"class": "form-control"}), "time_start_time": TimeInput(attrs={ "class": "form-control", "type": "time" }), "date_start_time": DateInput(attrs={ "class": "form-control", "type": "date" }), "time_end_time": TimeInput(attrs={ "class": "form-control", "type": "time" }), "date_end_time": DateInput(attrs={ "class": "form-control", "type": "date" }), } labels = { "title": "Titulo", "agent": "Solicitado", "description": "Descripcion", "time_start_time": "Hora Inicio", "date_start_time": "Fecha Inicio", "time_end_time": "Hora Fin", "date_end_time": "Fecha Fin", }
class TimeTrackingForm(ModelForm): date = DateField(widget=DateInput(format = '%d.%m.%Y'), input_formats=('%d.%m.%Y',)) start = TimeField(widget=TimeInput(format = '%H:%M'), input_formats=('%H:%M',)) end = TimeField(widget=TimeInput(format = '%H:%M'), input_formats=('%H:%M',)) class Meta: model = Time_Entry fields = ['description', 'project_id'] widgets = { 'current_day': DateInput() } error_messages = { 'description': { 'max_length': _('Die Beschreibung ist zu lang.'), }, }
class RestaurantForm(ModelForm): opening_time = TimeField(widget=TimeInput(attrs={'type': 'time' })) last_opening_time = TimeField(widget=TimeInput(attrs={'type': 'time' })) closing_time = TimeField(widget=TimeInput(attrs={'type': 'time' })) name = CharField() address = CharField() phone = CharField() capacity = IntegerField() image = URLField() description = Textarea() category = ModelChoiceField(queryset=Category.objects.all()) class Meta: model = Restaurant fields = ['name', 'description', 'address', 'phone', 'capacity', 'opening_time', 'last_opening_time', 'closing_time', 'image', 'category']
class Meta: model = IncidentReport fields = ['report_date', 'report_time', 'effected_members', 'staff_on_duty', 'description', 'damage', 'root_cause', 'mitigation', 'actions_taken', 'actions_todo'] labels = { 'report_date': 'Date when the incident happened:', 'report_time': 'Time when incident occured (HH:MM:SS):', 'effected_members': 'Select the members who were involved in the incident (select multiple):', 'staff_on_duty': 'Select the staff members on duty at the time (select multiple):', 'description': 'Briefly describe the incident:', 'damage': 'List any/all resulting injury or damage:', 'root_cause': 'Describe what factors lead to this incident. Why doesn\'t it normally happen?', 'mitigation': 'What can be done to prevent this kind of incident:', 'actions_taken': 'What actions were taken in responce to this incident:', 'actions_todo': 'What actions still need to be done:', } widgets = {'report_date': DateInput(attrs={'class': 'form-control datepicker'}), 'report_time': TimeInput(attrs={'class': 'form-control timepicker'}), 'effected_members': SelectMultiple(attrs={'class': 'form-control selectpicker', 'data-style': 'btn-primary'}), 'staff_on_duty': SelectMultiple(attrs={'class': 'form-control selectpicker', 'data-style': 'btn-primary'}), 'description': Textarea(attrs={'class': 'form-control'}), 'damage': Textarea(attrs={'class': 'form-control'}), 'root_cause': Textarea(attrs={'class': 'form-control'}), 'mitigation': Textarea(attrs={'class': 'form-control'}), 'actions_taken': Textarea(attrs={'class': 'form-control'}), 'actions_todo': Textarea(attrs={'class': 'form-control'}), }
class Meta: model = Cita widgets = { 'fecha': DateInput(attrs={'type': 'date'}, format='%Y-%m-%d'), 'hora': TimeInput(attrs={'type': 'time'}, format='%H:%M'), } fields = '__all__'
class Meta: model = Artificial_Insemination_Form exclude = [ 'vet_form', 'report_created_on', ] widgets = { 'time_of_heat_sign': TimeInput(attrs={'type': 'time'}), 'time_of_insemination': TimeInput(attrs={'type': 'time'}), 'date_of_insemination': DateInput(attrs={'type': 'date'}), 'date_of_birth': DateInput(attrs={'type': 'date'}), 'date_of_repeat_checked': DateInput(attrs={'type': 'date'}), 'date_of_pregnancy_diagnosis': DateInput(attrs={'type': 'date'}), 'expected_date_of_calving': DateInput(attrs={'type': 'date'}), }
class Meta: model = Irrigation fields = ['plant', 'water', 'time', 'date'] widgets = { "plant": NumberInput( attrs={ 'class': 'form-control', 'label': 'ID Растения', 'placeholder': 'ID Растения' }), "water": NumberInput( attrs={ 'class': 'form-control', 'label': 'Нома воды', 'placeholder': 'Нома воды' }), "time": TimeInput( attrs={ 'class': 'form-control', 'label': 'Время полива', 'placeholder': 'Время полива', }), "date": TextInput( attrs={ 'class': 'form-control', 'label': 'Частота полива', 'placeholder': 'Частота полива' }), }
class Meta: model = TestOrder fields = [ 'client_info', 'contact_no', 'email', 'address', 'test_info', 'payment_type', 'date', 'time' ] widgets = { 'client_info': Select(attrs={'class': 'form-control'}), 'contact_no': TextInput(attrs={'class': 'form-control'}), 'email': TextInput(attrs={'class': 'form-control'}), 'address': TextInput(attrs={'class': 'form-control'}), 'test_info': Select(attrs={'class': 'form-control'}), 'payment_type': Select(attrs={'class': 'form-control'}), 'date': SelectDateWidget(attrs={'class': 'form-control'}), 'time': TimeInput(format='%H:%M', attrs={ 'type': 'time', 'class': 'form-control' }), }
class Meta: model = models.FilmSession hall = ModelChoiceField(queryset=models.CinemaHall.objects.all(), empty_label=None, to_field_name="hall") film = ModelChoiceField(queryset=models.Film.objects.all(), empty_label=None, to_field_name="film") fields = ['hall', 'date', 'time', 'film', 'price', 'vip_price'] widgets= { 'date': DateInput(format=('%Y-%m-%d'), attrs={ 'type': "date", 'placeholder': "Введите дату показа", 'class': "form-control", 'id': "FilmSessionDate", }), 'time': TimeInput(format=('%H:%M'), attrs={ 'type': "time", 'placeholder': "Введите время показа", 'class': "form-control", 'id': "FilmSessionTime", }), 'price': NumberInput(attrs={ 'placeholder': "Введите стоимость показа", 'class': "form-control", 'id': "FilmSessionPrice", }), 'vip_price': NumberInput(attrs={ 'placeholder': "Введите стоимость показа в вип-зале", 'class': "form-control", }), }
class Meta: model = Appointment fields = ['date', 'time', 'pathlab'] widgets = { 'date': DateInput(attrs={'type': 'date'}), 'time': TimeInput(attrs={'type': 'time'}), }
class Meta: model = Reuniao exclude = (id, 'situacao', 'anotacao') widgets = { 'data': DateInput(attrs={ 'class': 'form-control', 'placeholder': 'Informe a data' }), 'inicio': TimeInput(attrs={ 'class': 'form-control', 'placeholder': 'Informe a hora de início' }), 'local': TextInput(attrs={ 'class': 'form-control', 'data-rules': 'required', 'placeholder': 'Informe o local' }), 'tipo': Select(attrs={ 'class': 'form-control', 'data-rules': 'required', 'empty_label': 'Selecione o tipo' }), # 'anotacao': Textarea(attrs={ # 'class': 'form-control', # 'data-rules': 'required', # 'placeholder': 'Informe a anotação' # }), 'comissao': Select(attrs={ 'class': 'form-control', 'data-rules': 'required', 'empty_label': 'Selecione a comissão' }), }
class TimeInputTest(WidgetTest): widget = TimeInput() def test_render_none(self): self.check_html(self.widget, 'time', None, html='<input type="text" name="time" />') def test_render_value(self): """ The microseconds are trimmed on display, by default. """ t = time(12, 51, 34, 482548) self.assertEqual(str(t), '12:51:34.482548') self.check_html( self.widget, 'time', t, html='<input type="text" name="time" value="12:51:34" />') self.check_html( self.widget, 'time', time(12, 51, 34), html=('<input type="text" name="time" value="12:51:34" />')) self.check_html( self.widget, 'time', time(12, 51), html=('<input type="text" name="time" value="12:51:00" />')) def test_string(self): """Initializing from a string value.""" self.check_html( self.widget, 'time', '13:12:11', html=('<input type="text" name="time" value="13:12:11" />')) def test_format(self): """ Use 'format' to change the way a value is displayed. """ t = time(12, 51, 34, 482548) widget = TimeInput(format='%H:%M', attrs={'type': 'time'}) self.check_html(widget, 'time', t, html='<input type="time" name="time" value="12:51" />') @override_settings(USE_L10N=True) @translation.override('de-at') def test_l10n(self): t = time(12, 51, 34, 482548) self.check_html( self.widget, 'time', t, html='<input type="text" name="time" value="12:51:34" />')