Ejemplo n.º 1
0
class PickPeriodForm(forms.Form):
    from django.forms.widgets import SelectDateWidget
    from transport.forms import SELECTYEARS
    start = forms.DateField(widget=SelectDateWidget(years=SELECTYEARS),
                            initial=timezone.now)
    end = forms.DateField(widget=SelectDateWidget(years=SELECTYEARS),
                          initial=timezone.now)
Ejemplo n.º 2
0
class ReadingTipUpdateForm(forms.ModelForm):
    class Meta:
        model = ReadingTip
        fields = ('title', 'description',)

    start_date = forms.DateField(
        widget=SelectDateWidget(empty_label=('Year', 'Month', 'Day')),
        required=False
    )
    
    end_date = forms.DateField(
        widget=SelectDateWidget(empty_label=('Year', 'Month', 'Day')),
        required=False
    )

    isbn = forms.CharField(
        label='ISBN',
        max_length=20,
        min_length=10,
        required=False,
    )

    url = forms.URLField(
        label='URL',
        max_length=255,
        required=False,
    )
Ejemplo n.º 3
0
def razzia_wizard(request):
    if request.method == 'POST':
        return redirect(
            reverse("razzia_view") +
            "?start={0}-{1}-{2}&end={3}-{4}-{5}&products={6}&username=&razzia_title={7}"
            .format(
                int(request.POST['start_year']),
                int(request.POST['start_month']), int(
                    request.POST['start_day']), int(request.POST['end_year']),
                int(request.POST['end_month']), int(request.POST['end_day']),
                request.POST.get('products'), request.POST.get('razzia_title'))
        )

    suggested_start_date = timezone.now() - datetime.timedelta(days=-180)
    suggested_end_date = timezone.now()

    start_date_picker = fields.DateField(widget=SelectDateWidget(
        years=[x for x in range(2000,
                                timezone.now().year + 1)]))
    end_date_picker = fields.DateField(widget=SelectDateWidget(
        years=[x for x in range(2000,
                                timezone.now().year + 1)]))

    return render(
        request,
        'admin/stregsystem/razzia/wizard.html',
        {
            'start_date_picker':
            start_date_picker.widget.render("start", suggested_start_date),
            'end_date_picker':
            end_date_picker.widget.render("end", suggested_end_date)
        },
    )
Ejemplo n.º 4
0
 def __init__(self, instance=None, **kwargs):
     super(ManageCampaignForm, self).__init__(instance=instance, **kwargs)
     work = instance.work
     edition_qs = Edition.objects.filter(work=work)
     self.fields['edition'] = forms.ModelChoiceField(
         edition_qs,
         widget=RadioSelect(),
         empty_label='no edition selected',
         required=False,
     )
     self.fields['target'] = forms.DecimalField(
         required=(instance.type in {REWARDS, BUY2UNGLUE}))
     self.fields['deadline'] = forms.DateTimeField(
         required = (instance.type==REWARDS),
         widget = SelectDateWidget(years=date_selector) if instance.status=='INITIALIZED' \
             else forms.HiddenInput
     )
     self.fields['cc_date_initial'] = forms.DateTimeField(
         required = (instance.type==BUY2UNGLUE) and instance.status=='INITIALIZED',
         widget = SelectDateWidget(years=date_selector) if instance.status=='INITIALIZED' \
             else forms.HiddenInput
     )
     self.fields['publisher'] = forms.ModelChoiceField(
         instance.work.publishers(),
         empty_label='no publisher selected',
         required=False,
     )
     if self.initial and not self.initial.get(
             'edition', None) and not instance.edition:
         self.initial['edition'] = instance.work.editions.all()[0]
Ejemplo n.º 5
0
class EditCourseForm(forms.ModelForm):
    name = forms.CharField(required=True,
                           widget=forms.TextInput(attrs={
                               'class': 'form-control',
                               'readonly': True
                           }))
    classroom = forms.CharField(widget=forms.TextInput(
        attrs={'class': 'form-control'}))
    credit = forms.CharField(widget=forms.TextInput(attrs={
        'type': 'number',
        'class': 'form-control'
    }))
    startTime = forms.DateField(
        label='开始时间', widget=SelectDateWidget(attrs={'class': 'form-control'}))
    endTime = forms.DateField(
        label='结束时间', widget=SelectDateWidget(attrs={'class': 'form-control'}))

    def __init__(self, *args, **kwargs):
        super(EditCourseForm, self).__init__(*args, **kwargs)

    class Meta:
        model = models.Course
        fields = [
            'name', 'term', 'classroom', 'credit', 'startTime', 'endTime'
        ]
Ejemplo n.º 6
0
class GenerateForm(forms.Form):
    # module content
    jump_links = forms.ChoiceField(initial=1, choices=INCLUDE_CHOICES)
    events = forms.ChoiceField(initial=1, choices=INCLUDE_CHOICES)
    event_start_dt = forms.DateField(initial=datetime.date.today(),
                                     widget=SelectDateWidget(
                                         None,
                                         list(range(1920, THIS_YEAR + 10))))
    event_end_dt = forms.DateField(
        initial=datetime.date.today() + datetime.timedelta(days=90),
        widget=SelectDateWidget(None, list(range(1920, THIS_YEAR + 10))))
    events_type = forms.ChoiceField(initial='',
                                    choices=get_type_choices(),
                                    required=False)
    articles = forms.ChoiceField(initial=1, choices=INCLUDE_CHOICES)
    articles_days = forms.ChoiceField(initial=60, choices=DAYS_CHOICES)
    news = forms.ChoiceField(initial=1, choices=INCLUDE_CHOICES)
    news_days = forms.ChoiceField(initial=30, choices=DAYS_CHOICES)
    jobs = forms.ChoiceField(initial=1, choices=INCLUDE_CHOICES)
    jobs_days = forms.ChoiceField(initial=30, choices=DAYS_CHOICES)
    pages = forms.ChoiceField(initial=0, choices=INCLUDE_CHOICES)
    pages_days = forms.ChoiceField(initial=7, choices=DAYS_CHOICES)

    #Campaign Monitor Template
    template = forms.ModelChoiceField(
        queryset=NewsletterTemplate.objects.all())
Ejemplo n.º 7
0
 class Meta:
     model = Course
     fields = [
         'title', 'sub_title', 'category', 'description', 'start_date',
         'finish_date', 'image'
     ]
     labels = {
         'sub_title': 'Sub Title',
         'image': 'Upload Image',
         'start_date': 'Start Date',
         'finish_date': 'Finish Date',
     }
     widgets = {
         'title':
         TextInput(attrs={
             'class': u'form-control',
             'placeholder': u'Enter Title'
         }),
         'sub_title':
         TextInput(attrs={
             'class': u'form-control',
             'placeholder': u'Enter Sub-Title'
         }),
         'description':
         Textarea(attrs={
             'class': u'form-control',
             'placeholder': u'Enter Description'
         }),
         'category':
         Select(attrs={'class': u'form-control'}),
         'start_date':
         SelectDateWidget(),
         'finish_date':
         SelectDateWidget(),
     }
Ejemplo n.º 8
0
class FormFecha(forms.Form):
    Desde = forms.DateField(widget=SelectDateWidget())
    Hasta = forms.DateField(widget=SelectDateWidget())


#class PostFilter(filters.FilterSet):
#   # Filtra por las fechas inferiores a la introducida
#    last_update_lte = django_filters.DateTimeFilter(name="last_update", lookup_expr='lte')
#   # Filtra por las fechas mayores a la introducida
#  last_update_gte = django_filters.DateTimeFilter(name="last_update", lookup_expr='gte')
# class Meta:
#    model = Post
#   # Especificamos el nombre de los campos filtro
#  fields = ['last_update_gte', 'last_update_lte']

#class PostFilter2(django_filters.FilterSet):
#	categoria__name = django_filters.CharFilter(lookup_expr='icontains')
#
#	release_year = django_filters.NumberFilter(field_name='fecha_publicacion', lookup_expr='year')
#	release_year__gt = django_filters.NumberFilter(field_name='fecha_publicacion', lookup_expr='year__gt')
#	release_year__lt = django_filters.NumberFilter(field_name='fecha_publicacion', lookup_expr='year__lt')
#
#	class Meta:
#		model = Post
#		fields = ['categoria', 'fecha_publicacion']
Ejemplo n.º 9
0
 def __init__(self, *args, **kwargs):
     super(SurveyForm, self).__init__(*args, **kwargs)
     MONTHS = {
         1: _('jan'), 2: _('feb'), 3: _('mar'), 4: _('apr'),
         5: _('maí'), 6: _('jún'), 7: _('júl'), 8: _('ágú'),
         9: _('sep'), 10: _('okt'), 11: _('nóv'), 12: _('des')
     }
     self.fields['active_from'].widget = SelectDateWidget(
         empty_label=("Ár", "Mánuður", "Dagur"),
         years=range(2016, timezone.now().year + 10),
         months=MONTHS,
         attrs={
             'class': 'required form-control',
             'style': 'width: 26%; display: inline-block;'
         })
     self.fields['active_to'].widget = SelectDateWidget(
         empty_label=("Ár", "Mánuður", "Dagur"),
         years=range(2016, timezone.now().year + 10),
         months=MONTHS,
         attrs={
             'class': 'required form-control',
             'style': 'width: 26%; display: inline-block;'
         })
     fields = [
         'identifier', 'title', 'survey_type', 'student_year', 'description'
     ]
     add_field_classes(self, fields)
Ejemplo n.º 10
0
class QueryForm(forms.Form):
    lot_ID = forms.CharField(widget=forms.Textarea(
        attrs={
            'class':
            'form-control',
            'rows':
            6,
            'placeholder':
            'Please separate lot ID by whitespace, e.g.\n'
            '000000.001 000002.001 XXXXXX.1X\n'
            '000000.001     XXXXXX.1X\n'
            '000001.001\n000002.001 \nXXXXXX.1X'
        }))
    upload_file = forms.FileField()
    this_year = datetime.date.today().year
    start_date = forms.DateField(widget=SelectDateWidget(
        years=range(this_year - 1, this_year + 1)))
    end_date = forms.DateField(widget=SelectDateWidget(
        years=range(this_year - 1, this_year + 1)))

    def clean(self):
        cleaned_data = super(QueryForm, self).clean()
        start_date = cleaned_data.get("start_date")
        end_date = cleaned_data.get("end_date")
        if start_date > end_date:
            raise forms.ValidationError(
                "Starting date should be smaller than ending date!")
        upload_file_name = cleaned_data.get("upload_file", False).name
        if not ".csv" in upload_file_name:
            raise forms.ValidationError("Uploaded file should be .csv!")
        return
Ejemplo n.º 11
0
class remove_choice_Form(forms.Form):
    MODELZ = [(i, (name_i)) for i, name_i in enumerate(MODELNAMES)]
    prefix = forms.ChoiceField(label="데이터", choices=MODELZ)
    start_date = forms.DateField(
        label="From", widget=SelectDateWidget(years=range(2016, 2024)))
    end_date = forms.DateField(
        label="To", widget=SelectDateWidget(years=range(2016, 2024)))
Ejemplo n.º 12
0
class BikeBookingForm(forms.ModelForm):
    bike = forms.ModelChoiceField(queryset=Bike.objects.all(), required=False)
    from_date = forms.DateField(
        widget=SelectDateWidget(years=YEARS, months=MONTHS))
    to_date = forms.DateField(
        widget=SelectDateWidget(years=YEARS, months=MONTHS))

    class Meta:
        model = BikesBooking
        fields = ['bike', 'full_days', 'from_date', 'to_date', 'subtotal']
        readonly_fields = ['subtotal']

    def clean(self):
        cleaned_data = super(BikeBookingForm, self).clean()
        from_date = cleaned_data.get('from_date')
        to_date = cleaned_data.get('to_date')
        bike = cleaned_data.get('bike')

        if from_date > to_date:
            raise forms.ValidationError(
                'Startdatumet får inte vara före slutdatumet')

        bike_dates = [
            date
            for date in BikeAvailable.objects.filter(bike=bike, available=True)
        ]
        numdays = to_date.day - from_date.day
        date_list = [(from_date + timedelta(days=x))
                     for x in range(0, numdays + 1)]

        if date_list not in bike_dates:
            raise forms.ValidationError(
                'Denna cykel är inte ledig mellan dessa datum')
Ejemplo n.º 13
0
    class Meta:
        model = Playlist
        fields = [
            'name',
            'd_tags',
            'description',
            'main_image',
            #'playout_mode_random',
            'rotation',
            'rotation_date_start',
            'rotation_date_end',
            'dayparts',
            'weather',
            'seasons',
            'target_duration',
            'series',
            'series_number'
        ]

        widgets = {
            'rotation_date_start':
            SelectDateWidget(
                years=ROTATION_YEAR_CHOICES,
                empty_label=(_('Year'), _('Month'), _('Day')),
            ),
            'rotation_date_end':
            SelectDateWidget(
                years=ROTATION_YEAR_CHOICES,
                empty_label=(_('Year'), _('Month'), _('Day')),
            ),
        }
Ejemplo n.º 14
0
class DateRangeForm(forms.Form):
    choices = ((settings.BMXAPI['udis_serie'],
                'Valor de UDIS'), (settings.BMXAPI['dolar_serie'],
                                   'Tipo de cambio Pesos por dólar E.U.A.'),
               (settings.BMXAPI['tiie28_serie'], 'TIIE a 28 días'),
               (settings.BMXAPI['tiie91_serie'], ' TIIE a 91 días'),
               (settings.BMXAPI['tiie182_serie'], 'TIIE a 182 días'))
    serie = forms.ChoiceField(choices=choices)
    start_date = forms.DateField(
        label='fecha inicial',
        initial=start.date(),
        required=True,
        widget=SelectDateWidget(years=range(1991, now.year + 1)))
    end_date = forms.DateField(
        label='fecha final',
        initial=now.date(),
        widget=SelectDateWidget(years=range(1991, now.year + 1)))

    def clean(self):
        cleaned_data = super().clean()
        start_date = cleaned_data.get("start_date")
        end_date = cleaned_data.get("end_date")
        if not start_date or end_date:
            return
        if start_date > end_date:
            raise forms.ValidationError(
                "fecha inicio debe ser anterior o igual a fecha final")
        return cleaned_data
Ejemplo n.º 15
0
class DateRangeForm(forms.Form):
    YEARS = range(2017, timezone.now().year + 2)

    start_date = forms.DateField(label='Startdatum',
                                 widget=SelectDateWidget(years=YEARS))
    end_date = forms.DateField(label='Enddatum',
                               widget=SelectDateWidget(years=YEARS))
Ejemplo n.º 16
0
class PriceForm(forms.ModelForm):
    start_date = forms.DateField(label=_("Start Date"),
                                 widget=SelectDateWidget())
    end_date = forms.DateField(label=_("End Date"), widget=SelectDateWidget())

    class Meta:
        model = Price
        fields = ['cost', 'currency', 'start_date', 'end_date', 'priority']
Ejemplo n.º 17
0
class FuncionForm(forms.ModelForm):
    fecha_inicio = forms.DateTimeField(widget=SelectDateWidget())
    fecha_fin = forms.DateTimeField(widget=SelectDateWidget())

    class Meta:
        model = Funcion
        fields = ('pelicula', 'fecha_inicio', 'fecha_fin', 'lugar',
                  'direccion', 'cupos')
Ejemplo n.º 18
0
class RentFormEx(forms.ModelForm):

    paid = forms.ChoiceField(choices=((True, 'Оплачена наличными'),
                                      (False, 'Оплата картой клиента')),
                             label="Кем будет производиться оплата")

    start = forms.DateField(widget=SelectDateWidget(empty_label="Nothing"),
                            initial=timezone.now(),
                            label="Начало аренды")
    end = forms.DateField(widget=SelectDateWidget(empty_label="Nothing"),
                          initial=timezone.now() + timedelta(days=1),
                          label="Окончание аренды")

    class Meta:
        fields = ('flat', 'start', 'end', 'paid')
        model = Booking

    def clean_start(self):
        start = self.cleaned_data['start']
        if start < date.today():
            raise ValidationError(
                "Дата начала аренды не может быть позднее, чем сегодня")
        return datetime.combine(start, datetime.min.time())

    def clean_end(self):
        end = self.cleaned_data['end']
        if end < date.today():
            raise ValidationError(
                "Дата окончания аренды не может быть позднее, чем сегодня")
        return datetime.combine(end, datetime.min.time())

    def save(self, commit=True):
        status = None
        paid = None
        if self.cleaned_data['paid'] == "False":
            status = 'waiting_for_capture'
            paid = False
        elif self.cleaned_data['paid'] == "True":
            status = 'succeeded'
            paid = True
        else:
            return False

        booking = Booking.objects.create(
            flat=self.cleaned_data['flat'],
            rentor_id=2,
            start=datetime.combine(self.cleaned_data['start'],
                                   datetime.min.time()),
            end=datetime.combine(self.cleaned_data['end'],
                                 datetime.min.time()),
            paid=paid,
            status=status,
            trial_key=str(uuid.uuid4())).setDates(add=3)
        print(booking)
        '''
        booking.createDeal()
        '''
        return True
Ejemplo n.º 19
0
class CreateAvailableBikeForm(forms.Form):
    action = forms.ChoiceField(choices=Action_Choices, required=False)
    bike = forms.ModelChoiceField(queryset=Bike.objects.all(),
                                  label='Välj cykel...',
                                  required=False)
    from_date = forms.DateField(widget=SelectDateWidget(
        years=YEARS, months=MONTHS, empty_label='Välj...'))
    to_date = forms.DateField(widget=SelectDateWidget(
        years=YEARS, months=MONTHS, empty_label='Välj...'))
Ejemplo n.º 20
0
 class Meta:
     model = Newsletter
     fields = "__all__"
     widgets = {
         'subject': forms.TextInput(attrs={'size': 50}),
         'event_start_dt': SelectDateWidget(None, list(range(THIS_YEAR, THIS_YEAR+10))),
         'event_end_dt': SelectDateWidget(None, list(range(THIS_YEAR, THIS_YEAR+10))),
         'format': forms.RadioSelect
     }
Ejemplo n.º 21
0
	def __init__(self, *args, **kwargs):
		from django.forms.widgets import HiddenInput, SelectDateWidget
		hide_condition = kwargs.pop('hide_condition',None)
		super(LeaveRequestForm, self).__init__(*args, **kwargs)
		self.fields['start_date'].widget = SelectDateWidget(years=years)
		self.fields['end_date'].widget = SelectDateWidget(years=years)

		if hide_condition:
			self.fields['employee'].widget = HiddenInput()
Ejemplo n.º 22
0
class PickExpPeriodForm(forms.Form):
    from django.forms.widgets import SelectDateWidget
    from transport.forms import SELECTYEARS
    expense = forms.CharField(max_length=30,
                              required=True,
                              widget=forms.Select(choices=EXPENSES))
    start_date = forms.DateField(widget=SelectDateWidget(years=SELECTYEARS),
                                 initial=timezone.now)
    end_date = forms.DateField(widget=SelectDateWidget(years=SELECTYEARS),
                               initial=timezone.now)
Ejemplo n.º 23
0
class UsageSearchForm(forms.Form):
    terms = forms.CharField(
        help_text="Searchs against Project IDs, Project names and "
        "Institute names (optional)",
        required=False)
    start_date = forms.DateField(widget=SelectDateWidget(
        years=range(todays_year, 2002, -1)))
    end_date = forms.DateField(
        initial=datetime.date.today().strftime('%Y-%m-%d'),
        widget=SelectDateWidget(years=range(todays_year, 2002, -1)))
Ejemplo n.º 24
0
class ChangeGroupPermissionsForm(forms.Form):

    canRead = forms.BooleanField(label='canRead', required=False)
    canWrite = forms.BooleanField(label='canWrite', required=False)
    canDelete = forms.BooleanField(label='', required=False,
                                   widget=forms.HiddenInput)

    effectiveDate = forms.DateTimeField(
        label='Effective Date', widget=SelectDateWidget(), required=False)
    expiryDate = forms.DateTimeField(
        label='Expiry Date', widget=SelectDateWidget(), required=False)
Ejemplo n.º 25
0
	class Meta:
		model = Sanciones
		fields = "__all__"
		widgets = {
			'IdAlumno':HiddenInput(),
			'Fecha':SelectDateWidget(),
			'Fecha_fin':SelectDateWidget(),
			
			'Sancion':TextInput(attrs={'size': '67'}),
			'Comentario': Textarea(attrs={'cols': 80, 'rows': 15}),
			#'Comentario': TinyMCE(),
            
        }
Ejemplo n.º 26
0
class CommonFilterForm(forms.Form):
    accountType = forms.MultipleChoiceField(
        widget=forms.CheckboxSelectMultiple,
        choices=accountTypes,
        label='Selected account types:')
    startDate = forms.DateField(
        widget=SelectDateWidget(years=range(2018,
                                            datetime.date.today().year + 1)),
        label='Start Date:')
    endDate = forms.DateField(
        widget=SelectDateWidget(years=range(2018,
                                            datetime.date.today().year + 1)),
        label='End Date:')
Ejemplo n.º 27
0
 class Meta:
     from .models import ObjectACL
     model = ObjectACL
     fields = [
         'canDelete',
         'canRead',
         'canWrite',
         'effectiveDate',
         'expiryDate',
         'isOwner',
     ]
     widgets = {
         'expiryDate': SelectDateWidget(),
         'effectiveDate': SelectDateWidget()}
Ejemplo n.º 28
0
class DateRangeForm(forms.Form):
    start_date = forms.DateField(required=False, label=_("Start Date"), widget=SelectDateWidget())
    end_date = forms.DateField(required=False, label=_("End Date"), widget=SelectDateWidget())

    def clean(self):
        cleaned_data = super().clean()
        start_date = cleaned_data.get('start_date')
        end_date = cleaned_data.get('end_date')

        if end_date and end_date < start_date:
            self.add_error('end_date', _('End Date cannot be before Start Date'))
            del(cleaned_data['end_date'])
            
        return cleaned_data
Ejemplo n.º 29
0
class TravelReceiptForm(forms.ModelForm):
    path_to_states = os.path.join(settings.STATIC_ROOT, 'states.pickle')
    with open(path_to_states, 'rb') as handle:
        tupled_list_states = pickle.load(handle)

    permanent_address1 = forms.CharField(label="Address Line 1",
                                         max_length=100)
    permanent_address2 = forms.CharField(label="Address Line 2",
                                         max_length=100,
                                         required=False)
    permanent_city = forms.CharField(label="City", max_length=50)
    permanent_state = forms.ChoiceField(label='State',
                                        choices=tupled_list_states)
    permanent_zip = forms.CharField(label="Zip", max_length=15)

    travel_date_from = forms.DateField(widget=SelectDateWidget(
        empty_label=("Choose Year", "Choose Month", "Choose Day"), ), )
    travel_date_to = forms.DateField(widget=SelectDateWidget(
        empty_label=("Choose Year", "Choose Month", "Choose Day"), ), )
    travel_location_city = forms.CharField(
        label="What city are you departing from?", max_length=50)
    travel_location_state = forms.ChoiceField(
        label='What state are you departing from?', choices=tupled_list_states)
    receipt_amount = forms.DecimalField(max_digits=6, decimal_places=2)
    reimburse_amount = forms.DecimalField(max_digits=6, decimal_places=2)
    receipt_file = forms.FileField(label='Upload Receipt',
                                   widget=forms.FileInput,
                                   required=True)
    policy_check = forms.BooleanField(
        label=
        "I have read the <a href='https://drive.google.com/open?id=1IRAy-KqUC7yyR0I8wi7oJ1IxWBkLKIlp'>Receipt Guidelines for Reimbursements</a> and understand that if my information is incorrect or not submitted properly, I will not eligible for a reimbursement."
    )

    def clean(self):
        cd = self.cleaned_data
        if cd.get('receipt_amount') < cd.get('reimburse_amount'):
            self.add_error(
                'reimburse_amount',
                "Reimbursement amount cannot be larger than the receipt amount!"
            )
        return cd

    class Meta:
        fields = ('permanent_address1', 'permanent_address2', 'permanent_city',
                  'permanent_state', 'permanent_zip', 'travel_date_from',
                  'travel_date_to', 'travel_location_city',
                  'travel_location_state', 'receipt_amount',
                  'reimburse_amount', 'receipt_file', 'policy_check')
        model = TravelAppModel
Ejemplo n.º 30
0
class StructuredDataSelect(forms.Form):
    def __init__(self, *args, **kwargs):
        model = kwargs.pop('model')
        modelname = model.__name__
        super(StructuredDataSelect, self).__init__(*args, **kwargs)
        DATARANGE = [(i, (name_i))
                     for i, name_i in enumerate(getDatelist2(model))]
        self.fields['prefix'].choices = DATARANGE
        self.fields['prefix'].label = modelname

    prefix = forms.ChoiceField(label="", choices=[])
    start_date = forms.DateField(
        label="From", widget=SelectDateWidget(years=range(2016, 2024)))
    end_date = forms.DateField(
        label="To", widget=SelectDateWidget(years=range(2016, 2024)))