Beispiel #1
0
class WebhookSchema(colander.Schema):
    hook_url = colander.SchemaNode(colander.String(),
                                   widget=widget.TextInputWidget())
    hook_type = colander.SchemaNode(colander.String(),
                                    widget=widget.SelectWidget(values=hooktypes),
                                    validator=colander.OneOf(('discord', 'generic')))
    enabled = colander.SchemaNode(colander.Boolean(),
                                  widget=widget.CheckboxWidget(template="bootstrap"), required=False)
    jumpEvents = colander.SchemaNode(colander.Boolean(),
                                     widget=widget.CheckboxWidget(template="bootstrap"), required=False)
    marketEvents = colander.SchemaNode(colander.Boolean(),
                                       widget=widget.CheckboxWidget(template="bootstrap"), required=False)
    calendarEvents = colander.SchemaNode(colander.Boolean(),
                                         widget=widget.CheckboxWidget(template="bootstrap"), required=False)
    description = colander.SchemaNode(colander.String(),
                                      widget=widget.TextInputWidget(), required=False)
    id = colander.SchemaNode(colander.Integer(),
                             widget=widget.HiddenWidget(),
                             required=False, default=None, missing=colander.drop)
    owner_id = colander.SchemaNode(colander.Integer(),
                                   widget=widget.HiddenWidget(),
                                   required=False, default=None, missing=colander.drop)
    carrier_id = colander.SchemaNode(colander.Integer(),
                                     widget=widget.HiddenWidget(),
                                     required=False, default=None, missing=colander.drop)
Beispiel #2
0
class WpAddSchema(MasterAddSchema):
    unit_nama = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(readonly=True),
        title="OPD",
        oid="unit_nama")
    wajibpajak_nm = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(readonly=True),
        title="Penyetor",
        oid="wajibpajak_nm")

    wp_nama = colander.SchemaNode(colander.String(),
                                  widget=widget.TextInputWidget(readonly=True),
                                  title="Nama Lain",
                                  oid="wp_nama")

    wp_alamat_1 = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(readonly=True),
        title="Alamat Subjek",
        oid="wp_alamat_1")

    wp_alamat_2 = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(readonly=True),
        title="Alamat Subjek",
        oid="wp_alamat_2")
Beispiel #3
0
class UserAddSchema(AdminUserAddSchema):
    unit_nama = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(readonly=True),
        title="OPD",
        oid="unit_nama",
        missing="",
    )
Beispiel #4
0
class UserAddSchema(MasterSchema):
    unit_nm = colander.SchemaNode(
        colander.String(),
        title="OPD",
        oid="unit_nm",
        widget=widget.TextInputWidget(readonly=True),
        missing="",
    )
Beispiel #5
0
class BankSchema(colander.Schema):
    mwidget = widget.TextInputWidget()
    amount_01 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    title = "Potongan-01",
                    default = 0, 
                    missing=colander.drop,                    
                )                                
Beispiel #6
0
class ForgotPasswordSchema(CSRFSchema):
    """Used on forgot password view."""

    email = c.SchemaNode(
        c.Str(),
        title='Email',
        validator=c.All(c.Email(), validate_user_exists_with_email),
        widget=w.TextInputWidget(size=40, maxlength=260, type='email', template="textinput_placeholder"),
        description="The email address under which you have your account. Example: [email protected]")
Beispiel #7
0
class ForgotPasswordSchema(CSRFSchema):
    email = c.SchemaNode(
        c.Str(),
        title=_('Email'),
        validator=c.All(c.Email(), email_exists),
        # type='email' will render an HTML5 email field
        # if you use deform_bootstrap_extra:
        widget=w.TextInputWidget(size=40, maxlength=260, type='email'),
        description=_("The email address under which you have your account. "
                      "Example: [email protected]"))
Beispiel #8
0
class CategorySchema(MappingSchema):
    name  = SchemaNode(String(),
                        description = 'Name der Kategorie')
    comment = SchemaNode(String(),
                        widget = widget.TextInputWidget(size=40),
                        missing='',
                        description = 'Kommentar zur Kategorie')
    title='Neue Kategorie'

    def update(self):
        pass
Beispiel #9
0
class CarrierExtraSettings(colander.MappingSchema):
    carrier_image = colander.SchemaNode(deform.FileData(),
                                        widget=widget.FileUploadWidget(tmpstore=tmpstore),
                                        title='Carrier Image',
                                        description="Choose file to upload",
                                        missing=colander.null)
    carrier_motd = colander.SchemaNode(colander.String(),
                                       widget=widget.TextInputWidget(),
                                       description="Set your carrier's Motto / MOTD.",
                                       title="Carrier Motto",
                                       validator=colander.Length(max=150),
                                       missing=colander.null)
Beispiel #10
0
class FlightFormSchema(MappingSchema):
    name = SchemaNode(String(),
                      description='The name of this thing')
    title = SchemaNode(String(),
                       widget=widget.TextInputWidget(size=40),
                       validator=Length(max=20),
                       description='A very short title')
    password = SchemaNode(String(),
                          widget=widget.CheckedPasswordWidget(),
                          validator=Length(min=5))
    is_cool = SchemaNode(Boolean(),
                         default=True
                         )
Beispiel #11
0
class RegisterSchema(CSRFSchema):
    """Username-less registration form schema."""

    email = c.SchemaNode(
        c.String(),
        title='Email',
        validator=c.All(c.Email(), validate_unique_user_email),
        widget=w.TextInputWidget(size=40, maxlength=260, type='email'))

    password = c.SchemaNode(
        c.String(),
        validator=c.Length(min=PASSWORD_MIN_LENGTH),
        widget=deform.widget.CheckedPasswordWidget(),
    )
Beispiel #12
0
class MySchema(MappingSchema):
    name = SchemaNode(String(), description='The name of this thing')
    title = SchemaNode(String(),
                       widget=widget.TextInputWidget(size=40),
                       validator=Length(max=20),
                       description='A very short title')
    password = SchemaNode(String(),
                          widget=widget.CheckedPasswordWidget(),
                          validator=Length(min=5))
    is_cool = SchemaNode(Boolean(), default=True)
    dates = DatesSchema()
    color = SchemaNode(String(),
                       widget=widget.RadioChoiceWidget(values=colors),
                       validator=OneOf(('red', 'blue')))
Beispiel #13
0
class LoginSchema(CSRFSchema):
    """Login form schema.

    The user can log in both with email and his/her username, though we recommend using emails as users tend to forget their usernames.
    """

    username = c.SchemaNode(c.String(),
                            title='Email',
                            validator=c.All(c.Email()),
                            widget=w.TextInputWidget(size=40,
                                                     maxlength=260,
                                                     type='email'))

    password = c.SchemaNode(c.String(), widget=deform.widget.PasswordWidget())
Beispiel #14
0
 class RouteSchema(colander.Schema):
     id = colander.SchemaNode(colander.Integer(),
                              widget=widget.HiddenWidget(),
                              required=False, default=None, missing=colander.drop)
     carrier_id = colander.SchemaNode(colander.Integer(),
                                      widget=widget.HiddenWidget(),
                                      required=True, default=mycarrier.id)
     routeName = colander.SchemaNode(colander.String(),
                                     widget=widget.TextInputWidget(),
                                     title="Name your route")
     startRegion = colander.SchemaNode(colander.String(),
                                       widget=widget.Select2Widget(
                                           values=choices,
                                           css_class='select2 select2-container select2-container--default '
                                                     'select2-container--below select2-container--focus ',
                                                     style='width:100%'
                                       ), title="Starting Region")
     startSystem = colander.SchemaNode(colander.String(),
                                       widget=widget.AutocompleteInputWidget(
                                           values='https://system.api.fuelrats.com/typeahead', min_length=3
                                       ), title="Starting system", id='startingsystem')
     waypoints = WaypointSequence(title='Waypoints')
     endRegion = colander.SchemaNode(colander.String(),
                                     widget=widget.Select2Widget(
                                         values=choices,
                                         css_class='select2 select2-container select2-container--default '
                                                   'select2-container--below select2-container--focus',
                                         style='width:100%'
                                     ), title="Ending Region")
     endSystem = colander.SchemaNode(colander.String(),
                                     widget=widget.AutocompleteInputWidget(
                                         values='https://system.api.fuelrats.com/typeahead', min_length=3
                                     ), title="Destination System", id='destinationsystem')
     description = colander.SchemaNode(colander.String(),
                                       widget=widget.TextInputWidget(), title='Route description',
                                       missing=colander.drop)
Beispiel #15
0
class RegisterSchema(CSRFSchema):
    username = c.SchemaNode(c.String(), title=_('User name'),
                            description=_("Name with which you will log in"),
                            validator=unique_username)
    email = c.SchemaNode(
        c.String(),
        title=_('Email'),
        validator=c.All(c.Email(), unique_email),
        description=_("Example: [email protected]"),
        widget=w.TextInputWidget(size=40, maxlength=260, type='email'))
    password = c.SchemaNode(
        c.String(),
        validator=c.Length(min=4),
        widget=deform.widget.CheckedPasswordWidget(),
        description=_("Your password must be harder than a "
                      "dictionary word or proper name!")
    )
Beispiel #16
0
class AliasSchema(Schema):
    """ The property schema for ``Alias`` objects."""
    name = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(),
        validator=alias_name_validator,
    )
    resource = colander.SchemaNode(
        colander.String(),
        widget=keys_autocomplete_widget,
        validator=alias_resource_validator,
    )
    anchor = colander.SchemaNode(
        colander.String(),
        missing=None,
    )
    query = QueryParams()
Beispiel #17
0
class AddSchema(colander.Schema):
    user_widget = widget.AutocompleteInputWidget(size=60,
                                                 values='/user/headofnama/act',
                                                 min_length=1)

    group_name = colander.SchemaNode(colander.String(),
                                     widget=widget.TextInputWidget(),
                                     oid="group_name")
    user_name = colander.SchemaNode(
        colander.String(),
        #widget = user_widget,
        oid="user_name")
    group_id = colander.SchemaNode(colander.Integer(),
                                   widget=widget.HiddenWidget(),
                                   oid="group_id")
    user_id = colander.SchemaNode(colander.Integer(),
                                  widget=widget.HiddenWidget(),
                                  oid="user_id")
Beispiel #18
0
class BPSchema(colander.Schema):
    mwidget = widget.TextInputWidget()
    amount_07 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-07",
                    missing=0,                    
                )                                
    amount_08 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-08",
                    missing=0,                    
                )                                
    amount_09 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-09",
                    missing=0,                    
                )                                
    amount_10 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    title = "Potongan-10",
                    default = 0, 
                    missing=0,                    
                )                                
    amount_11 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-11",
                    missing=0,                    
                )                                
    amount_12 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-12",
                    missing=0,                    
                )                                
Beispiel #19
0
class ItemSchema(MappingSchema):
    db = sqlite()
    name  = SchemaNode(String(),
                        description = 'Bezeichnung des Items',
                        title='Name')
    categories = db.getAllCategories()
    categories = [(cat, cat) for (cat, comment) in categories]
    category = SchemaNode(
                String(),
                widget=widget.SelectWidget(values=categories),
                        description = 'Standardkategorie des Items'
                )
    comment = SchemaNode(String(),
                        widget = widget.TextInputWidget(size=40),
                        missing='',
                        description = 'Kommentar zum Item')
    title='Neues Item'

    def update(self):
        categories = self.db.getAllCategories()
        categories = [(cat, cat) for (cat, comment) in categories]
        self['category'].widget = widget.SelectWidget(values=categories)
Beispiel #20
0
class BendaharaSchema(colander.Schema):
    mwidget = widget.TextInputWidget()
    amount_02 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-02",
                    missing=0,                    
                )                                
    amount_03 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    title = "Potongan-03",
                    default = 0, 
                    missing=0,                    
                )                                
    amount_04 = colander.SchemaNode(
                    colander.Integer(),
                    default = 0, 
                    widget = mwidget,
                    title = "Potongan-04",
                    missing=0,                    
                )                                
    amount_05 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-05",
                    missing=0,                    
                )                                
    amount_06 = colander.SchemaNode(
                    colander.Integer(),
                    widget = mwidget,
                    default = 0, 
                    title = "Potongan-06",
                    missing=0,                    
                )                                
Beispiel #21
0
class AddAccountSchema(colander.Schema):
    """

    """
    # couTimestamp
    cou = colander.SchemaNode(
        colander.Boolean(),
        title='Security and Acceptable Use Policy Acceptance',
        description='Terms and Conditions Agreement - Check this if '
        'you have read and agree to abide by the Center\'s '
        'Security and Acceptable Use Policies.',
        widget=widget.CheckboxWidget(),
        validator=cou_validator,
        oid='cou')

    #   storTimestamp
    stor = colander.SchemaNode(
        colander.Boolean(),
        title='Data Security Policy Acceptance',
        description='Check this if you have read and agree '
        'to the Center\'s storage policies.',
        widget=deform.widget.CheckboxWidget(),
        validator=stor_validator,
        oid='stor')
    #   cybeTimestamp
    # cyber = colander.SchemaNode(
    #     colander.Boolean(),
    #     title='Cyber Security Policy Acceptance',
    #     description='Check this if you have read and agree to abide by '
    #                 'the Center\'s Cyber Security policies.',
    #     widget=deform.widget.CheckboxWidget(),
    #     validator=cyber_validator,
    #     oid='cyber'
    # )

    # titlePrefix = colander.SchemaNode(
    #     colander.String(),
    #     title='Honorary',
    #     description='If you prefer to use n honorary, enter it here.',
    #     # validator=colander.ContainsOnly([x[0] for x in title_prefixes]),
    #     #validator=colander.Length(min=1, max=64),
    #     widget=widget.TextInputWidget(placeholder="Dr., Mr., Ms., etc."),
    #     missing=unicode(''),
    #     oid='titlePrefix'
    # )

    givenName = colander.SchemaNode(
        colander.String(),
        title='Given/First name',
        description='Your given or first name',
        validator=colander.Length(min=1, max=64),
        widget=widget.TextInputWidget(placeholder=''),
        oid='givenName')

    middleName = colander.SchemaNode(
        colander.String(),
        title='Middle name/initial',
        description='Middle name or initial',
        validator=colander.Length(min=0, max=64),
        widget=widget.TextInputWidget(placeholder=''),
        missing=unicode(''),
        oid='middleName')

    sn = colander.SchemaNode(colander.String(),
                             title='Family/Last Name',
                             description='family Name / Last Name',
                             validator=colander.Length(min=1, max=64),
                             widget=widget.TextInputWidget(placeholder=''),
                             oid='sn')

    suffix = colander.SchemaNode(
        colander.String(),
        title='Suffix',
        description='(Sr. Jr. IV, etc.)',
        validator=colander.Length(min=0, max=32),
        widget=widget.TextInputWidget(placeholder='example: III, PhD, etc.'),
        missing=unicode(''),
        oid='suffix')

    cn = colander.SchemaNode(
        colander.String(),
        title='Common or Nick Name',
        description='Your full name. How you want to be addressed.',
        validator=colander.Length(min=3, max=64),
        widget=widget.TextInputWidget(
            placeholder='(Optional) How you want to be addressed '
            'if different from: FirstName LastName'),
        missing=unicode(''),
        oid='cn')

    street = colander.SchemaNode(
        colander.String(),
        title='Street Address',
        description='',
        validator=colander.Length(min=0, max=200),
        widget=widget.TextInputWidget(
            placeholder='business/institution address'),
        oid='street')

    lcity = colander.SchemaNode(colander.String(),
                                title='City',
                                description='',
                                validator=colander.Length(min=1, max=128),
                                widget=widget.TextInputWidget(),
                                oid='lcity')

    st = colander.SchemaNode(colander.String(),
                             title='State/Province',
                             description='',
                             validator=colander.Length(min=1, max=128),
                             widget=widget.TextInputWidget(),
                             oid='l')

    postalCode = colander.SchemaNode(colander.String(),
                                     title='Post/ZIP Code',
                                     description='',
                                     validator=colander.Length(min=2, max=64),
                                     widget=widget.TextInputWidget(),
                                     oid='postalCode')

    country = colander.SchemaNode(
        colander.String(),
        title='Country',
        description='',
        widget=widget.SelectWidget(values=country_codes),
        #validator=colander.OneOf([x[0] for x in country_codes]),
        validator=valid_country,
        oid='country')

    mail = colander.SchemaNode(
        colander.String(),
        title='EMail',
        description='Your primary email account',
        # validator=colander.Email(msg="Please provide your work Email address. This will be the primary account we use to contact you."),
        widget=email_confirm_widget,
        oid='mail')

    # mailPreferred = colander.SchemaNode(
    #     colander.String(),
    #     title='Preferred EMail',
    #     description='optional preferred email account',
    #     missing=unicode(''),
    #     widget=pref_email_confirm_widget,
    #     oid='mail'
    # )

    phone = colander.SchemaNode(
        colander.String(),
        title='Phone number',
        description='Please provide your primary telephone number',
        validator=phone_validator,
        widget=widget.TextInputWidget(),
        oid='phone')

    cell = colander.SchemaNode(
        colander.String(),
        title='Cell phone number',
        description='For contact and verification',
        validator=phone_validator,
        missing=unicode(''),
        widget=widget.TextInputWidget(
            placeholder='(Optional) example: +1-000-000-0000'),
        oid='cell')

    employerType = colander.SchemaNode(
        colander.String(),
        validator=colander.OneOf([x[0] for x in employer_types]),
        widget=deform.widget.RadioChoiceWidget(values=employer_types),
        title='Employer Type',
        description='Select the employer type from the list below that '
        'is most appropriate to your request',
        oid="employerType")

    employerName = colander.SchemaNode(
        colander.String(),
        title='Employer, Institution, or Sponsor Name',
        description='Please provide the name of your employer or '
        'the institution you represent',
        validator=colander.Length(min=3, max=128),
        widget=widget.TextInputWidget(placeholder='employer name here'),
        oid='employerName')

    citizenStatus = colander.SchemaNode(
        colander.String(),
        title='Citizenship Status',
        description='Select one of the following options '
        'that best describes your U.S. citizenship status',
        validator=colander.OneOf([x[0] for x in citizen_types]),
        widget=widget.RadioChoiceWidget(values=citizen_types),
        oid='citizenStatus')

    citizenships = colander.SchemaNode(
        colander.Set(),
        title='Citizenships',
        description='Please select your country or countries of citizenship',
        validator=valid_countries,
        widget=widget.Select2Widget(values=country_codes, multiple=True),
        oid='citizenships',
    )

    #   birthCountry
    birthCountry = colander.SchemaNode(
        colander.String(),
        title='Country of birth',
        description='Please enter/select your country of birth',
        validator=valid_country,
        widget=widget.Select2Widget(values=country_codes),
        oid='birthCountry',
    )

    isnreluser = colander.SchemaNode(
        colander.String(),
        title='Existing NREL Account?',
        description="Select the option that is most true for you.",
        widget=deform.widget.RadioChoiceWidget(values=has_account),
        missing=unicode(''),
        label='Existing or Previous ESIF HPC UserID',
        oid='isnreluser')

    nrelUserID = colander.SchemaNode(
        colander.String(),
        title='Your Existing NREL HPC UserID',
        description='If you have --or previously had-- an NREL UserID, '
        'enter it here.',
        validator=colander.Length(min=1, max=16),
        widget=widget.TextInputWidget(placeholder='example: jsmythe'),
        missing=unicode(''),
        oid='nrelUserID')

    justification = colander.SchemaNode(
        colander.String(),
        title='NREL HPC User Credential Information',
        widget=widget.TextAreaWidget(rows=6, columns=60),
        missing=unicode(''),
        validator=colander.Length(max=1000),
        description="If you don't have an account on NREL HPC systems, "
        "we need some additional information. Please provide "
        "the project handles or titles of the project allocations "
        "you are associated with. "
        "If you don't have an allocation, please tell us "
        "why you are requesting NREL HPC login credentials.",
        oid='comments')

    preferredUID = colander.SchemaNode(
        colander.String(),
        title='*New* ESIF HPC UserID',
        description="Please provide your desired User ID here.<sup>1</sup>"
        "(3 to 16 characters, all lower case.)",
        validator=colander.Length(min=3, max=16),
        widget=widget.TextInputWidget(placeholder="example: jsmythe"),
        missing=unicode(''),
        oid='preferredUID')

    comments = colander.SchemaNode(
        colander.String(),
        title='Additional Notes or Comments',
        widget=deform.widget.TextAreaWidget(
            rows=6,
            columns=60,
            placeholder='If you think we need any additional '
            'information to process or approve your request, '
            'please let us know (project name, PI, NREL contact, etc.).'),
        missing=unicode(''),
        validator=colander.Length(max=1000),
        description='If you think we need any additional '
        'information to process or approve your request, '
        'please let us know.',
        oid='comments')
Beispiel #22
0
class QueryParams(colander.SequenceSchema):
    key_value = colander.SchemaNode(
        colander.String(),
        validator=colander.Length(min=1),
        widget=widget.TextInputWidget(),
    )
Beispiel #23
0
class AddSchema(colander.Schema):
    npwpd = colander.SchemaNode(
        colander.String(),
        widget=widget.TextInputWidget(max=14),
        #validator=npwpd_validator,
        title="NPWPD",
        oid="npwpd")
    m_pjk_bln = colander.SchemaNode(colander.String(),
                                    widget=widget.SelectWidget(values=BULANS),
                                    title="Bulan",
                                    oid="m_pjk_bln")
    m_pjk_thn = colander.SchemaNode(colander.String(),
                                    widget=widget.SelectWidget(values=TAHUNS),
                                    title="Tahun",
                                    oid="m_pjk_thn")
    kd_bayar = colander.SchemaNode(colander.String(),
                                   missing=colander.drop,
                                   title='Kode Bayar',
                                   oid="kd_bayar")
    kd_status = colander.SchemaNode(colander.Integer(),
                                    title='Status.bayar',
                                    missing=colander.drop,
                                    oid="kd_status")
    npwpd1 = colander.SchemaNode(colander.String(),
                                 missing=colander.drop,
                                 title='NPWPD',
                                 oid="npwpd1")
    nm_perus = colander.SchemaNode(colander.String(),
                                   missing=colander.drop,
                                   title='Nama',
                                   oid="nm_perus")
    al_perus = colander.SchemaNode(colander.String(),
                                   missing=colander.drop,
                                   title='Alamat',
                                   oid="al_perus")
    vol_air = colander.SchemaNode(colander.Integer(),
                                  title='Volume',
                                  missing=colander.drop,
                                  oid="vol_air")
    npa = colander.SchemaNode(colander.Integer(),
                              title='NPS',
                              missing=colander.drop,
                              oid="npa")
    bea_pok_pjk = colander.SchemaNode(colander.Integer(),
                                      title='Bea Pokok Pjk',
                                      missing=colander.drop,
                                      oid="bea_pok_pjk")
    bea_den_pjk = colander.SchemaNode(colander.Integer(),
                                      title='Bea Denda Pjk',
                                      missing=colander.drop,
                                      oid="bea_den_pjk")
    m_pjk_bln1 = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='Bulan',
                                     oid="m_pjk_bln1")
    m_pjk_thn1 = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='Tahun',
                                     oid="m_pjk_thn1")
    tgl_tetap = colander.SchemaNode(colander.String(),
                                    missing=colander.drop,
                                    title='Tgl. Penetapan',
                                    oid="tgl_tetap")
    tgl_jt_tempo = colander.SchemaNode(colander.String(),
                                       missing=colander.drop,
                                       title='Tgl. Jth Tempo',
                                       oid="tgl_jt_tempo")
    keterangan = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='Keterangan',
                                     oid="keterangan")
class FormConfigurar(CSRFSchema):
    """
    Formulário para configuração de perfil do usuário
    """
    
    nome = SchemaNode(
        String(),
        validator=All(
            Length(max=32),
            #Function(verif_email_unico, u"Nome já cadastrado"),
            Regex("^(\w)*$", "Usar apenas letras, números ou _"),
        ),
        missing=unicode(''),		
        description='Digite seu nome de usuário'
    )
    sobrenome = SchemaNode(
        String(),
        validator=All(
            Length(max=32),
            #Function(verif_nome_unico, u"Nome já cadastrado"),
        ),
        missing=unicode(''),		
        description='Digite seu sobrenome'
    )	
    genero = SchemaNode(
        String(),
        missing=unicode(''),
        widget=widget.SelectWidget(values=generos),
        title = "Gênero",		
    )	
    nascimento = SchemaNode(
        String(),	
        #máscara não funciona....
		#Date(),
        missing=unicode(''),
        description='Digite a data de nascimento',
		#DateInputWidget não dá erro pelo menos..
        widget= widget.TextInputWidget(mask='99/99/9999')
    )        
    """
    erro	
    foto = SchemaNode(
        deform.FileData(),
        widget=widget.FileUploadWidget(tmpstore),
        missing=unicode(''),		
        description='Carregar foto'
    ) 
    """		
    rua = SchemaNode(
        String(),
        missing=unicode(''),		
        description='Digite sua rua')
    bairro = SchemaNode(
        String(),
        missing=unicode(''),		
        description='Digite seu bairro')
    cidade = SchemaNode(
        String(),
        missing=unicode(''),		
        description='Digite sua cidade')
    estado = SchemaNode(
        String(),
        missing=unicode(''),
        widget=widget.SelectWidget(values=estados))		
    informacoes = SchemaNode(
        String(),
        missing=unicode(''),		
        description='Digite informações sobre você',
        title='Informações',
        validator=Length(max=100),
        widget=widget.TextAreaWidget(rows=10, cols=60)
    )		
    senha = SchemaNode(
        String(),
        missing=unicode(''),		
        validator=Length(min=5, max=32),
        widget=widget.CheckedPasswordWidget(size=20),
        description='Alterar sua senha (no mínimo 5 caracteres) e a confirme'
    )

    notificacoes_site = SchemaNode(
        Boolean(),	
        label='Receber notificações pelo site',
        widget=widget.CheckboxWidget(),
        title='Notificações',
        missing=unicode(''),		
    )	
    notificacoes_email = SchemaNode(
        Boolean(),	
        label='Receber notificações pelo email',
        widget=widget.CheckboxWidget(),
        title='Notificações',
        missing=unicode(''),		
    )	
    atualizacoes_pontos = SchemaNode(
        Boolean(),	
        label='Atualizações de pontos próximos ao endereço cadastrado',
        widget=widget.CheckboxWidget(),
        title='Atualização',
        missing=unicode(''),		
    )	
    atualizacoes_eventos = SchemaNode(
        Boolean(),	
        label='Eventos próximos ao endereço cadastrado',
        widget=widget.CheckboxWidget(),
        title='Atualização',
        missing=unicode(''),		
    )	
Beispiel #25
0
@colander.deferred
def deferred_citizenships_validator(node, kw):
    countries = kw.get('countries', [])
    return colander.OneOf([x[0] for x in countries])
# email_confirm_widget = deform.widget.CheckedInputWidget(
#             subject='Email address',
#             confirm_subject='Confirm your Email address',
#             )
#
# pref_email_confirm_widget = deform.widget.CheckedInputWidget(
#             subject='Optional Preferred Email',
#             confirm_subject='Confirm your optional Email address',
#             )

sn_widget = widget.TextInputWidget(css_class='form-control')


@colander.deferred
def deferred_country_widget(node, kw):
    country_codes_data = kw.get('country_codes_data', [])
    return widget.Select2Widget(values=country_codes_data)


@colander.deferred
def deferred_state_widget(node, kw):
    us_states_data = kw.get('us_states_data', [])
    return widget.Select2Widget(values=us_states_data)


@colander.deferred
Beispiel #26
0
class AddSchema(colander.Schema):
    moneywidget = widget.MoneyInputWidget(size=20,
                                          options={
                                              'allowZero': True,
                                              'precision': 0
                                          })
    kode = colander.SchemaNode(colander.String(),
                               title="Kode Bayar",
                               widget=widget.TextInputWidget(
                                   mask='9999-9.99.99-999999',
                                   mask_placeholder='#',
                               ))

    arinvoice_id = colander.SchemaNode(
        colander.Integer(),
        oid="arinvoice_id",
        widget=widget.HiddenWidget(readonly=True),
        missing=colander.drop,
        default=0)

    unit_nama = colander.SchemaNode(
        colander.String(),
        title="OPD",
        #title="SKPD",
        oid="unit_nama",
        missing=colander.drop)

    wp_nama = colander.SchemaNode(
        colander.String(),
        title="Subjek",
        oid="wp_nama",
        missing=colander.drop,
    )

    rek_nama = colander.SchemaNode(
        colander.String(),
        title="Rekening",
        oid="rek_nama",
        missing=colander.drop,
    )

    op_nama = colander.SchemaNode(colander.String(),
                                  title="Objek",
                                  missing=colander.drop,
                                  oid="op_nama")
    bank_id = colander.SchemaNode(
        colander.String(),
        title="Bank",
        oid="bank_id",
        missing=colander.drop,
    )
    channel_id = colander.SchemaNode(colander.String(),
                                     oid="channel_id",
                                     missing=colander.drop)
    ntb = colander.SchemaNode(
        colander.String(),
        title="NTB",
        oid="ntb",
        missing=colander.drop,
    )
    ntp = colander.SchemaNode(colander.String(),
                              oid="ntp",
                              missing=colander.drop)

    periode_1 = colander.SchemaNode(
        colander.String(),
        title="Periode 1",
        oid="periode_1",
        missing=colander.drop,
    )
    periode_2 = colander.SchemaNode(colander.String(),
                                    title="Periode 2",
                                    oid="periode_2",
                                    missing=colander.drop)
    tgl_tetap = colander.SchemaNode(
        colander.String(),
        oid="tgl_tetap",
    )
    jatuh_tempo = colander.SchemaNode(
        colander.String(),
        oid="jatuh_tempo",
        missing=colander.drop,
    )
    terutang = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="terutang",
        missing=colander.drop,
    )
    denda = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="denda",
        missing=colander.drop,
    )
    bunga_awal = colander.SchemaNode(
        colander.Integer(),
        default=0,
        oid="bunga_awal",
        widget=moneywidget,
        missing=colander.drop,
    )

    jumlah = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="jumlah",
        missing=colander.drop,
    )

    bunga = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="bunga",
        missing=colander.drop,
    )
    bayar = colander.SchemaNode(
        colander.Integer(),
        default=0,
        widget=moneywidget,
        oid="bayar",
        missing=colander.drop,
    )
    tgl_bayar = colander.SchemaNode(colander.Date(),
                                    widget=widget.DateInputWidget(),
                                    missing=colander.drop)
Beispiel #27
0
class AddSchema(colander.Schema):
    no_rangka = colander.SchemaNode(colander.String(),
                                    widget=widget.TextInputWidget(max=40),
                                    validator=form_validator,
                                    title='No. Rangka')
    no_ktp = colander.SchemaNode(colander.String(),
                                 title='No. Identitas',
                                 oid="no_ktp")
    email = colander.SchemaNode(colander.String(),
                                validator=email_validator,
                                title='E-Mail')
    no_hp = colander.SchemaNode(colander.String(),
                                title='No. Handphone',
                                oid="no_hp")
    kd_status = colander.SchemaNode(colander.String(),
                                    title='Status.bayar',
                                    missing=colander.drop,
                                    oid="kd_status")
    no_rangka1 = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='No. Rangka',
                                     oid="no_rangka1")
    no_ktp1 = colander.SchemaNode(colander.String(),
                                  missing=colander.drop,
                                  title='No. Identitas',
                                  oid="no_ktp1")
    kd_bayar = colander.SchemaNode(colander.String(),
                                   missing=colander.drop,
                                   title='Kode Bayar',
                                   oid="kd_bayar")
    tg_bayar_bank = colander.SchemaNode(colander.String(),
                                        missing=colander.drop,
                                        title='Tgl. Bayar',
                                        oid="tg_bayar_bank")
    no_polisi = colander.SchemaNode(colander.String(),
                                    missing=colander.drop,
                                    title='No. Polisi',
                                    oid="no_polisi")
    ket = colander.SchemaNode(colander.String(),
                              missing=colander.drop,
                              title='Keterangan',
                              oid="ket")
    nm_pemilik = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='Nama Pemilik',
                                     oid="nm_pemilik")
    warna_tnkb = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='Warna TNKB',
                                     oid="warna_tnkb")
    nm_merek_kb = colander.SchemaNode(colander.String(),
                                      missing=colander.drop,
                                      title='Merk Kendaraan',
                                      oid="nm_merek_kb")
    nm_model_kb = colander.SchemaNode(colander.String(),
                                      missing=colander.drop,
                                      title='Model Kendaraan',
                                      oid="nm_model_kb")
    th_buatan = colander.SchemaNode(colander.String(),
                                    missing=colander.drop,
                                    title='Thn. Pembuatan',
                                    oid="th_buatan")
    tg_akhir_pjklm = colander.SchemaNode(colander.String(),
                                         missing=colander.drop,
                                         title='Tgl. Pajak Lama',
                                         oid="tg_akhir_pjklm")
    tg_akhir_pjkbr = colander.SchemaNode(colander.String(),
                                         missing=colander.drop,
                                         title='Tgl. Pajak Baru',
                                         oid="tg_akhir_pjkbr")
    bbn_pok = colander.SchemaNode(colander.Integer(),
                                  missing=colander.drop,
                                  title='Pokok BBN',
                                  oid="bbn_pok")
    bbn_den = colander.SchemaNode(colander.Integer(),
                                  missing=colander.drop,
                                  title='Denda BBN',
                                  oid="bbn_den")
    pkb_pok = colander.SchemaNode(colander.Integer(),
                                  missing=colander.drop,
                                  title='Pokok PKB',
                                  oid="pkb_pok")
    pkb_den = colander.SchemaNode(colander.Integer(),
                                  missing=colander.drop,
                                  title='Denda PKB',
                                  oid="pkb_den")
    swd_pok = colander.SchemaNode(colander.Integer(),
                                  missing=colander.drop,
                                  title='Pokok SWDKLLJ',
                                  oid="swd_pok")
    swd_den = colander.SchemaNode(colander.Integer(),
                                  missing=colander.drop,
                                  title='Denda SWDKLLJ',
                                  oid="swd_den")
    adm_stnk = colander.SchemaNode(colander.Integer(),
                                   missing=colander.drop,
                                   title='Adm. STNK',
                                   oid="adm_stnk")
    adm_tnkb = colander.SchemaNode(colander.Integer(),
                                   missing=colander.drop,
                                   title='Adm. TNKB',
                                   oid="adm_tnkb")
    jumlah = colander.SchemaNode(colander.Integer(),
                                 missing=colander.drop,
                                 title='Jumlah',
                                 oid="jumlah")
    kd_trn_bank = colander.SchemaNode(colander.String(),
                                      missing=colander.drop,
                                      title='NTB',
                                      oid="kd_trn_bank")
    kd_trn_dpd = colander.SchemaNode(colander.String(),
                                     missing=colander.drop,
                                     title='NTP',
                                     oid="kd_trn_dpd")
Beispiel #28
0
class EditRequestSchema(colander.Schema):
    #   cybeTimestamp
    couTimestamp = colander.SchemaNode(
        colander.DateTime(),
        title='Security and Acceptable Use Policy Acceptance',
        description='date',
        widget=widget.DateInputWidget(),
        oid='couTimestamp'
    )

    givenName = colander.SchemaNode(
        colander.String(),
        title='Given/First name',
        description='Your given or first name',
        validator=colander.Length(min=1, max=64),
        widget=widget.TextInputWidget(),
        oid='givenName'
    )

    middleName = colander.SchemaNode(
        colander.String(),
        title='Middle name/initial',
        description='Middle name or initial',
        validator=colander.Length(min=0, max=64),
        widget=widget.TextInputWidget(),
        missing=unicode(''),
        oid='middleName'
    )

    sn = colander.SchemaNode(
        colander.String(),
        title='Family/Last Name',
        description='family Name / Last Name',
        validator=colander.Length(min=1, max=64),
        widget=widget.TextInputWidget(),
        oid='sn'
    )

    suffix = colander.SchemaNode(
        colander.String(),
        title='Suffix',
        description='(Sr. Jr. IV, etc.)',
        validator=colander.Length(min=0, max=32),
        widget=widget.TextInputWidget(),
        missing=unicode(''),
        oid='suffix'
    )

    cn = colander.SchemaNode(
        colander.String(),
        title='Common or Nick Name',
        description='Your full name. How you want to be addressed.',
        validator=colander.Length(min=3, max=64),
        widget=widget.TextInputWidget(),
        missing=unicode(''),
        oid='cn'
    )

    street = colander.SchemaNode(
        colander.String(),
        title='Street Address',
        description='',
        validator=colander.Length(min=0, max=200),
        widget=widget.TextInputWidget(),
        oid='street'
    )

    lcity = colander.SchemaNode(
        colander.String(),
        title='City',
        description='',
        validator=colander.Length(min=1, max=128),
        widget=widget.TextInputWidget(),
        oid='lcity'
    )

    st = colander.SchemaNode(
        colander.String(),
        title='State/Province',
        description='',
        validator=colander.Length(min=1, max=128),
        widget=widget.TextInputWidget(),
        oid='l'
    )

    postalCode = colander.SchemaNode(
        colander.String(),
        title='Post/ZIP Code',
        description='',
        validator=colander.Length(min=2, max=64),
        widget=widget.TextInputWidget(),
        oid='postalCode'
    )

    country = colander.SchemaNode(
        colander.String(),
        title='Country',
        description='',
        widget=widget.TextInputWidget(values=country_codes),
        validator=valid_country,
        oid='country'
    )

    mail = colander.SchemaNode(
        colander.String(),
        title='EMail',
        description='Your primary email account',
        widget=widget.TextInputWidget(),
        oid='mail'
    )
    #
    # mailPreferred = colander.SchemaNode(
    #     colander.String(),
    #     title='Preferred EMail',
    #     description='optional preferred email account',
    #     missing=unicode(''),
    #     widget=widget.TextInputWidget(),
    #     oid='mail'
    # )

    phone = colander.SchemaNode(
        colander.String(),
        title='Phone number',
        description='Please provide your primary telephone number',
        validator=phone_validator,
        widget=widget.TextInputWidget(),
        oid='phone'
    )

    cell = colander.SchemaNode(
        colander.String(),
        title='Cell phone number',
        description='For contact and verification',
        validator=phone_validator,
        missing=unicode(''),
        widget=widget.TextInputWidget(),
        oid='cell'
    )

    employerType = colander.SchemaNode(
        colander.String(),
        # validator=colander.OneOf([x[0] for x in employer_types]),
        validator=colander.OneOf([x[0] for x in employer_types]),
        widget=deform.widget.RadioChoiceWidget(values=employer_types),
        title='Employer Type',
        description='',
        oid="employerType"
    )

    employerName = colander.SchemaNode(
        colander.String(),
        title='Employer/Institution/Sponsor',
        description='Provided employer or institution name',
        validator=colander.Length(min=3, max=128),
        widget=widget.TextInputWidget(),
        oid='employerName'
    )

    citizenStatus = colander.SchemaNode(
        colander.String(),
        title='Citizenship Status',
        description='Select one of the following options '
                    'that best describes your U.S. citizenship status',
        validator=colander.OneOf([x[0] for x in citizen_types]),
        widget=widget.RadioChoiceWidget(values=citizen_types),
        oid='citizenStatus'
    )

    citizenships = colander.SchemaNode(
        colander.Set(),
        title='Citizenships',
        description='Please select your country or countries of citizenship',
        # validator=valid_countries,
        default=deferred_citz_default,
        widget=deferred_citizenships_widget,
        oid='citizenships',
    )

    birthCountry = colander.SchemaNode(
        colander.String(),
        title='Country of birth',
        description='Please enter/select your country of birth',
        validator=valid_country,
        # widget=widget.Select2Widget(values=country_codes),
        widget=widget.TextInputWidget(),
        oid='birthCountry',
    )

    nrelUserID = colander.SchemaNode(
        colander.String(),
        title='Your Existing NREL HPC UserID',
        description='If you have --or previously had-- an NREL UserID, '
                    'enter it here.',
        validator=colander.Length(min=1, max=16),
        widget=widget.TextInputWidget(),
        missing=unicode(''),
        oid='nrelUserID'
    )

    justification = colander.SchemaNode(
        colander.String(),
        title='Justification',
        widget=widget.TextAreaWidget(),
        missing=unicode(''),
        validator=colander.Length(max=1000),
        description="The provided justification/comments for new account.",
        oid='comments'
    )

    preferredUID = colander.SchemaNode(
        colander.String(),
        title='Requested UserID',
        description="The userid the user would prefer",
        validator=colander.Length(min=3, max=16),
        widget=widget.TextInputWidget(),
        missing=unicode(''),
        oid='preferredUID'
    )

    comments = colander.SchemaNode(
        colander.String(),
        title='Additional Notes or Comments',
        widget=widget.TextAreaWidget(),
        missing=unicode(''),
        validator=colander.Length(max=1000),
        description='Additional information',
        oid='comments'
    )

    UserID = colander.SchemaNode(
        colander.String(),
        title='Assigned Permanent HPC UserID',
        description='Determined by Center Operations.'
                    ' This MUST match what is in IDM.',
        validator=colander.Length(min=1, max=16),
        widget=widget.TextInputWidget(),
        default=None,
        missing=unicode(''),
        oid='UserID'
    )

    approvalStatus = colander.SchemaNode(
        colander.Integer(),
        title='Approval Status',
        description='The current status of the request\'s review process',
        validator=colander.OneOf([x[0] for x in approval_status]),
        default=0,
        widget=widget.RadioChoiceWidget(values=approval_status),
        oid='approvalStatus'
    )