class Meta: model = Outing fields = ['reason', 'out_time', 'in_time'] widgets = { 'out_time': TimePickerInput(), 'in_time': TimePickerInput(), }
class Meta: model = Quest fields = ('name', 'visible_to_students', 'xp', 'icon', 'short_description', 'verification_required', 'instructions', 'campaign', 'common_data', 'submission_details', 'instructor_notes', 'repeat_per_semester', 'max_repeats', 'hours_between_repeats', 'specific_teacher_to_notify', 'blocking', 'hideable', 'sort_order', 'date_available', 'time_available', 'date_expired', 'time_expired', 'available_outside_course', 'archived', 'editor') date_options = { 'showMeridian': False, # 'todayBtn': True, 'todayHighlight': True, # 'minuteStep': 5, 'pickerPosition': 'bottom-left', } time_options = { 'pickerPosition': 'bottom-left', 'maxView': 0, } widgets = { 'instructions': SummernoteInplaceWidget(), 'submission_details': SummernoteInplaceWidget(), 'instructor_notes': SummernoteInplaceWidget(), 'date_available': DatePickerInput(format='%Y-%m-%d'), 'time_available': TimePickerInput(), 'date_expired': DatePickerInput(format='%Y-%m-%d'), 'time_expired': TimePickerInput(), }
def test_time_input_snapshot(self): dp_input = TimePickerInput() html = dp_input.render('input_name', '12:30', {}) snapshot = open('tests/snapshots/time-input.html').read() html = re.sub('dp_\\d+', '', html) snapshot = re.sub('dp_\\d+', '', snapshot) self.assertEqual(html, snapshot)
class RoutineForm(forms.ModelForm): class Meta: model = Routine fields = [ 'classroom', 'section', 'subject_name', 'day', 'teacher', 'start_time', 'end_time', 'room_no' ] widgets = { 'start_time': TimePickerInput(), 'end_time': TimePickerInput(), } def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['section'].queryset = Section.objects.none() self.fields['subject_name'].queryset = Subject.objects.none() if 'classroom' in self.data: try: classroom_id = int(self.data.get('classroom')) self.fields['section'].queryset = Section.objects.filter( classroom_id=classroom_id).order_by('classroom') self.fields['subject_name'].queryset = Subject.objects.filter( classroom_id=classroom_id).order_by('classroom') except (ValueError, TypeError): pass elif self.instance.pk: self.fields[ 'section'].queryset = self.instance.classroom.section_set.order_by( 'section') self.fields[ 'subject_name'].queryset = self.instance.classroom.subject_set.order_by( 'subject_name')
class DateMatchingForm(forms.Form): clients = forms.ModelChoiceField( queryset=Client.objects.all().order_by('uuid', 'name')) start_date = forms.DateField(widget=DatePickerInput(format='%Y-%m-%d')) start_time = forms.DateField(widget=TimePickerInput()) end_date = forms.DateField(widget=DateTimePickerInput(format='%Y-%m-%d')) end_time = forms.DateField(widget=TimePickerInput())
class Meta: model = Board fields = ['title','pr_inst','pr_startdate','pr_enddate','pr_location', 'pr_tranbus','pr_transub','pr_day','pr_starttime','pr_endtime','pr_num','body','pr_file'] widgets={ 'title': forms.Textarea(attrs={'placeholder':'제목을 입력하세요','class':'form-control','rows':1}), 'body': CKEditorWidget(), 'pr_inst' : forms.Textarea(attrs={'class': 'form-control','rows' : 1}), 'pr_startdate' : DatePickerInput(format='%Y-%m-%d').start_of('practice-date'), 'pr_enddate' : DatePickerInput(format='%Y-%m-%d').end_of('practice-date'), 'pr_location' : forms.Textarea(attrs={'class': 'form-control','rows':1}), 'pr_tranbus' : forms.Textarea(attrs={'class': 'form-control','rows':1}), 'pr_transub' : forms.Textarea(attrs={'class': 'form-control','rows':1}), 'pr_starttime' : TimePickerInput(attrs={'placeholder':'오전 09시 시작인 경우, 09:00'}).start_of('practice-time'), 'pr_endtime' : TimePickerInput(attrs={'placeholder':'오후 03시 종료인 경우, 15:00'}).end_of('practice-time'), 'pr_day' : forms.Textarea(attrs={'class': 'form-control','rows':1}), 'pr_num' : forms.Textarea(attrs={'class': 'form-control','rows':1}), } labels={ 'title' : '제목', 'pr_inst' : '기관명', 'pr_startdate' : '실습시작일', 'pr_enddate' : '실습종료일', 'pr_location' : '위치', 'pr_tranbus' : '인근버스', 'pr_transub' : '인근지하철', 'pr_day' : '근무요일', 'pr_starttime' : '근무시작시간', 'pr_endtime' : '근무종료시간', 'pr_num' : '실습인원', 'body' : '내용', 'pr_file' : '첨부파일', }
class Meta: model = Booking exclude = ['poster', 'vehicle', 'is_scheduled'] widgets = { 'slot_date': DatePickerInput(), 'slot_time': TimePickerInput(), 'slot_end_time': TimePickerInput(), }
class Meta: model = SecClass fields = ('name', 'course', 'secType', 'days', 'instructor', 'classSize', 'room', 'startTime', 'endTime') widgets = { 'startTime': TimePickerInput(), 'endTime': TimePickerInput() }
class Meta: model = Fuller fields = [ 'name', 'speciality', 'salary', 'days', 'from_time', 'to_time' ] widgets = { 'from_time': TimePickerInput().start_of('party time'), 'to_time': TimePickerInput().end_of('party time'), }
class ClinicForm(forms.ModelForm): date = forms.DateField(widget=DatePickerInput()) start_time = forms.TimeField(widget=TimePickerInput()) end_time = forms.TimeField(widget=TimePickerInput()) class Meta: model = Clinic fields = "__all__" exclude = ["doctor"]
class Meta: model = Event fields = ('title','start_date','end_date','start_time','end_time','location') widgets = { 'start_date':DatePickerInput(), 'end_date':DatePickerInput(), 'start_time':TimePickerInput(), 'end_time':TimePickerInput(), }
class FilterForm(forms.ModelForm): start_time = forms.TimeField(widget=TimePickerInput(), initial='10:00') end_time = forms.TimeField(widget=TimePickerInput(), initial='18:00') date = forms.DateField(widget=DatePickerInput(format='%d.%m.%Y')) class Meta: model = Footage fields = ('footype', 'foocause')
class Meta: model = Event fields = ('title','start_date','end_date','start_time','end_time','location') widgets = { 'start_date':DatePickerInput().start_of('event days'), 'end_date':DatePickerInput().end_of('event days'), 'start_time':TimePickerInput().start_of('party time'), 'end_time':TimePickerInput().end_of('party time'), }
class Meta: model = ExamSchedule fields = ('exam', 'classroom', 'subject', 'exam_date', 'start_time', 'end_time', 'room_no', 'note') widgets = { 'exam_date': DatePickerInput(), 'start_time': TimePickerInput(), 'end_time': TimePickerInput(), }
class Meta: model = Brassin exclude = ['ingredient'] attrs = {'class': 'form-control'} widgets = { 'date_brassin': DatePickerInput(format='%d/%m/%Y'), 'date_mise_bouteille': DatePickerInput(format='%d/%m/%Y'), 'temps_empatage': TimePickerInput(), 'temps_fermentation': TimePickerInput(), 'temps_ebullition': TimePickerInput(), }
class Meta: model = Tracking fields = [ 'date', 'start_time', 'end_time', 'categories', 'element', 'notiz' ] widgets = { 'date': DatePickerInput(), 'start_time': TimePickerInput(), 'end_time': TimePickerInput(), 'notiz': forms.TextInput(attrs={'size': '30'}) }
class Meta: model = ReserveAirspace fields = ("rpas", "start_day", "start_time", "end", "geom", "log") widgets = { "geom": LeafletWidget(), "start_day": widgets.SelectDateWidget(), "start_time": TimePickerInput(), "end": TimePickerInput(), # 'rpas': forms.widgets.Select(attrs={'readonly': True, # 'disabled': True}) }
class Meta: model = NotamAirspace fields = ("reason", "start_day", "start_time", "end", "geom", "notam_file") widgets = { "geom": ExtLeafletWidget(), "start_day": widgets.SelectDateWidget(), "start_time": TimePickerInput(), "end": TimePickerInput(), }
class AddScheduleForm(forms.ModelForm): start_time = forms.TimeField(required=True, widget=TimePickerInput(format='H:m')) end_time = forms.TimeField(required=True, widget=TimePickerInput(format='H:m')) shop = forms.ModelChoiceField(queryset=Shop.objects.all(), label='Coffeehouse') class Meta: model = Schedule exclude = ('user', 'approve_date')
class Meta: model = Log fields = ('technician', 'client', 'subject', 'date', 'start_time', 'end_time', 'total_hours', 'service_type', 'category', 'description', 'status') labels = {"date": "Date", "start_time": "Start", "end_time": "End"} widgets = { 'date': DatePickerInput(), 'start_time': TimePickerInput(), 'end_time': TimePickerInput(), }
class Meta: model = ReserveAirspace # rpas = forms.ModelMultipleChoiceField(queryset=Rpas.objects.filter(user=request.user).order_by('-id')) fields = ("rpas", "start_day", "start_time", "end", "geom", "log") widgets = { "geom": ExtLeafletWidget(), # "start_day": widgets.SelectDateWidget(), "start_day": widgets.SelectDateWidget(), "start_time": TimePickerInput(), "end": TimePickerInput(), }
class Meta: model = Flight # show all fields # fields = '__all__' # Show specific fields fields = ('departure_location', 'departure_date', 'departure_time', 'arrival_location', 'arrival_date', 'arrival_time', 'cost') # add class attributes to form fields # widgets = { # 'departure_time': forms.DateTimeInput(format=('%d/%m/%Y %H:%M'), # attrs={ # 'class': 'form-control', # 'placeholder': 'Select a date', # 'type': 'date', # 'required': True # }), # } widgets = { 'departure_date': DatePickerInput( attrs={ 'class': 'form-control', 'placeholder': 'Select a date', 'required': True }), 'departure_time': TimePickerInput( attrs={ 'class': 'form-control', 'placeholder': 'Select a date', 'required': True }), 'arrival_date': DatePickerInput( attrs={ 'class': 'form-control', 'placeholder': 'Select a date', 'required': True }), 'arrival_time': TimePickerInput( attrs={ 'class': 'form-control', 'placeholder': 'Select a date', 'required': True }), }
class ConcertForm(forms.ModelForm): #Form used for creating a new concert artist = forms.CharField(max_length=128) date = forms.DateField(input_formats=['%d/%m/%Y'], widget=DatePickerInput(format="%d/%m/%Y")) start_time = forms.TimeField(widget=TimePickerInput(format="%H:%M")) end_time = forms.TimeField(widget=TimePickerInput(format="%H:%M")) image = forms.ImageField() url = forms.URLField() description = forms.CharField(max_length=1000) spotify_URI = forms.CharField(max_length=100, required = False) class Meta(forms.ModelForm): model = Concert exclude = {'venue', 'concertID'}
class Meta(): model = Activity fields = ('activity_type', 'name', 'start', 'end', 'spent_time') widgets = { 'start': TimePickerInput(options={ "format": 'HH:mm', "stepping": 15, }), 'end': TimePickerInput(options={ "format": 'HH:mm', "stepping": 15, }), 'spent_time': forms.HiddenInput(), }
class Meta: model = Operation fields = ( "fullname", "patient", "dent", "appointment", "special", "price", "advance", ) day = forms.DateField(widget=DatePickerInput(format='%m/%d/%Y')) widgets = { 'day': DatePickerInput(), 'time': TimePickerInput(), 'special': forms.Textarea( attrs={ 'class': 'form-control', 'placeholder': 'Description here...', 'cols': 80, 'rows': 10 }), }
class Meta: model = Event fields = ['file_csv', 'day', 'time'] widgets = { 'day': DatePickerInput(), 'time': TimePickerInput(), }
class AddAdminScheduleForm(forms.ModelForm): start_time = forms.TimeField(required=True, widget=TimePickerInput(format='H:m')) end_time = forms.TimeField(required=True, widget=TimePickerInput(format='H:m')) shop = forms.ModelChoiceField(queryset=Shop.objects.all(), label='Coffeehouse', required=True) user = forms.ModelChoiceField( queryset=User.objects.filter(employee__isnull=False), required=True, label='Employee') class Meta: model = Schedule exclude = ('approve_date', )
def get_form(self): date = datetime.datetime.now().date() form = super().get_form() generico = Projeto.objects.filter(nome="Genérico").get().pk form.fields['projeto'].initial = generico form.fields['referencia'].widget = DatePickerInput( format='%Y-%m-%d', attrs={'placeholder': date.isoformat()}, ) form.fields['duracao'].widget = TimePickerInput( format='%H:%M', attrs={'placeholder': '08:00'}, options={ "showClose": True, "showClear": False, "showTodayButton": False, "stepping": 5, }) form.fields['duracao'].initial = "08:00" current_user = self.request.user try: form.fields['projeto'].queryset = Projeto.objects.filter( colaboradores=Colaborador.objects.filter(user=current_user)[0]) except: pass return form
class Meta: model = Turnos fields = ['Paciente', 'FechaTurno', 'HoraTurno', 'Asistencia'] widgets = { 'FechaTurno': DatePickerInput(format='%d/%m/%Y'), 'HoraTurno': TimePickerInput(), }
class Meta: model = Consulta fields = ( 'dentistaCRO', 'dataC', 'horaC', 'procedimentos' ) labels = { 'dentistaCRO': _('Selecione um Denitsta:'), 'dataC': _('Data da Consulta:'), 'horaC': _('Horário da Consulta:'), 'procedimentos': _('Selecione os procedimentos:'), } widgets = { 'dataC': DatePickerInput( options={ "format": "DD/MM/YYYY", "locale": "pt-br", } ), 'horaC' : TimePickerInput( options = { "locale": "pt-br", } ), }