Beispiel #1
0
 class fields(ew_core.NameList):
     startdate = ew.TextField(label='Start date',
                              validator=formencode.All(
                                  V.DateValidator(),
                                  fev.UnicodeString(not_empty=True)))
     enddate = ew.TextField(label='End date',
                            validator=formencode.All(
                                V.DateValidator(),
                                fev.UnicodeString(not_empty=True)))
Beispiel #2
0
 def birth_date_fields(self):
     return [
         ew.TextField(name='birthdate',
                      label='Birth date',
                      validator=V.DateValidator(),
                      attrs=dict(value=None)),
         _HTMLExplanation(text="Use the format DD/MM/YYYY",
                          show_errors=False)
     ]
Beispiel #3
0
 class fields(ew_core.NameList):
     sex = ew.SingleSelectField(
         label='Gender',
         options=[
             ew.Option(py_value=v, label=v, selected=False)
             for v in ['Male', 'Female', 'Unknown', 'Other']
         ],
         validator=formencode.All(
             V.OneOfValidator(['Male', 'Female', 'Unknown', 'Other']),
             fev.UnicodeString(not_empty=True)))
     birthdate = ew.TextField(label='Birth date',
                              validator=V.DateValidator(),
                              attrs=dict(value=None))
     exp = _HTMLExplanation(text="Use the format DD/MM/YYYY",
                            show_errors=False)
     country = ew.SingleSelectField(
         label='Country of residence',
         validator=V.MapValidator(country_names, not_empty=False),
         options = [
             ew.Option(
                 py_value=" ", label=" -- Unknown -- ", selected=False)] +\
             [ew.Option(py_value=c, label=n, selected=False)
              for c,n in sorted(country_names.items(),
                                key=lambda (k,v):v)],
         attrs={'onchange':'selectTimezone(this.value)'})
     city = ew.TextField(label='City of residence',
                         attrs=dict(value=None),
                         validator=fev.UnicodeString(not_empty=False))
     timezone=ew.SingleSelectField(
         label='Timezone',
         attrs={'id':'tz'},
         validator=V.OneOfValidator(common_timezones, not_empty=False),
         options=[
              ew.Option(
                  py_value=" ",
                  label=" -- Unknown -- ")] + \
              [ew.Option(py_value=n, label=n)
               for n in sorted(common_timezones)])
Beispiel #4
0
 class fields(ew_core.NameList):
     startdate = ew.TextField(label='Start date',
                              validator=V.DateValidator())
     enddate = ew.TextField(label='End date', validator=V.DateValidator())