Ejemplo n.º 1
0
class PatchPortForm(SelectRoomForm):
    name = TextField(label="Name",
                     validators=[DataRequired()],
                     filters=[to_uppercase])
    switch_room = static(TextField(label="Switchraum"))

    _order = ("name", "switch_room")
Ejemplo n.º 2
0
class SwitchForm(SelectRoomForm):
    name = TextField(label="Name",
                     validators=[DataRequired()],
                     filters=[to_lowercase])
    management_ip = TextField(label="Management IP",
                              validators=[DataRequired(),
                                          IPAddress()])
Ejemplo n.º 3
0
class UserEditForm(Form):
    name = TextField(u"Name", [DataRequired(message=u"Name wird benötigt!")])
    email = TextField(u"E-Mail",
                      [Optional(), Email(u"E-Mail-Adresse ist ungültig!")])
    email_forwarded = BooleanField("E-Mail Weiterleitung", default=True)
    birthdate = DateField(u"Geburtsdatum", [Optional()])
    person_id = IntegerField("Debitorennummer", [Optional()],
                             filters=[empty_to_none])
Ejemplo n.º 4
0
class EditRoomForm(CreateAddressForm):
    building = static(TextField("Wohnheim"))
    level = static(IntegerField("Etage"))
    number = TextField("Nummer")
    vo_suchname = TextField("VO Nummer",
                            validators=[Optional()],
                            filters=[empty_to_none])
    inhabitable = BooleanField("Bewohnbar", validators=[Optional()])
    _order = ('building', 'level', 'number', 'vo_suchname', 'inhabitable',
              *iter_prefixed_field_names(CreateAddressForm, 'address_'))
Ejemplo n.º 5
0
class UserBaseDataForm(Form):
    name = TextField(u"Name", [DataRequired(message=u"Name wird benötigt!"),
                               UniqueName()])

    login = TextField(u"Login", [
        DataRequired(message=u"Login wird benötigt!"),
        Regexp(regex=User.login_regex_ci, message=u"Login ist ungültig!"),
        validate_unique_login
    ], filters=[to_lowercase])
    email = TextField(u"E-Mail", [Email(message=u"E-Mail ist ungueltig!"),
                                  Optional()], filters=[empty_to_none])
Ejemplo n.º 6
0
class PropertyGroupForm(Form):
    name = TextField("Gruppenname", [
        DataRequired("Name?"),
        Regexp("^[a-zA-Z0-9äöüÄÖÜ ]{3,}$",
               message="Namen ohne Sonderzeichen und mindestens 3 Buchstaben"
               " eingeben! (RegEx: ^[a-zA-Z0-9äöüÄÖÜ ]{3,}$)")
    ])
    permission_level = IntegerField("Berechtigungslevel")
Ejemplo n.º 7
0
class CreateRoomForm(CreateAddressForm):
    building = QuerySelectField("Wohnheim",
                                get_label='short_name',
                                query_factory=building_query)
    level = IntegerField("Etage")
    number = TextField("Nummer")
    vo_suchname = TextField("VO Nummer",
                            validators=[Optional()],
                            filters=[empty_to_none])
    inhabitable = BooleanField("Bewohnbar", validators=[Optional()])

    _order = (
        'building',
        'level',
        'number',
        'vo_suchname',
        'inhabitable',
        *iter_prefixed_field_names(CreateAddressForm, 'address_'),
    )
Ejemplo n.º 8
0
class AccountCreateForm(Form):
    name = TextField(u"Name", validators=[DataRequired()])
    type = SelectField(u"Typ",
                       validators=[DataRequired()],
                       choices=[
                           ("ASSET", "Aktivkonto"),
                           ("LIABILITY", "Passivkonto"),
                           ("EXPENSE", "Aufwandskonto"),
                           ("REVENUE", "Ertragskonto"),
                       ])
Ejemplo n.º 9
0
class PreMemberEditForm(UserBaseDataForm, SelectRoomForm):
    # overrides `email` from UserBaseDataForm
    email = TextField("E-Mail", [DataRequired("Mitgliedschaftsanfragen benötigen E-Mail"),
                                 Email(message="E-Mail ist ungueltig!")], filters=[empty_to_none])
    birthdate = DateField(u"Geburtsdatum", [DataRequired("Das Geburtsdatum wird benötigt!")])
    move_in_date = DateField("Einzugsdatum", [Optional()])
    person_id = IntegerField("Debitorennummer", [Optional()], filters=[empty_to_none])

    force = ConfirmCheckboxField("* Hinweise ignorieren")

    _order = ("name", "building", "level", "room_number")
Ejemplo n.º 10
0
class SwitchPortForm(Form):
    name = TextField(label="Name",
                     validators=[DataRequired()],
                     filters=[to_uppercase])
    patch_port = QuerySelectField(label="Patch-Port",
                                  get_label="name",
                                  allow_blank=True)
    default_vlans = QuerySelectMultipleField(
        label="Standard VLANs",
        get_label=lambda vlan: "{} ({})".format(vlan.name, vlan.vid),
        query_factory=vlan_query,
        allow_blank=True,
        render_kw={'size': 25})
Ejemplo n.º 11
0
class BankAccountCreateForm(Form):
    name = TextField(u"Name")
    bank = TextField(u"Bank")
    account_number = TextField(u"Kontonummer")
    routing_number = TextField(u"Bankleitzahl (BLZ)")
    iban = TextField(u"IBAN")
    bic = TextField(u"BIC")
    fints = TextField(u"FinTS-Endpunkt", default="https://mybank.com/…")

    def validate_iban(self, field):
        if BankAccount.q.filter_by(iban=field.data).first() is not None:
            raise ValidationError("Konto existiert bereits.")
Ejemplo n.º 12
0
class TransactionCreateForm(Form):
    description = TextField(u"Beschreibung", validators=[DataRequired()])
    valid_on = DateField(u"Gültig ab",
                         validators=[Optional()],
                         today_btn=True,
                         today_highlight=True,
                         default=datetime.date.today())
    splits = FieldList(FormField(SplitCreateForm),
                       validators=[DataRequired()],
                       min_entries=2)

    def validate_splits(self, field):
        balance = sum(split_form['amount'].data for split_form in field
                      if split_form['amount'].data is not None)
        if balance != 0:
            raise ValidationError(u"Buchung ist nicht ausgeglichen.")
Ejemplo n.º 13
0
class MembershipFeeCreateForm(Form):
    name = TextField(u"Beitragsname", validators=[DataRequired()])
    regular_fee = MoneyField(u"Regulärer Beitrag",
                             validators=[InputRequired(),
                                         NumberRange(min=0)])

    # TODO Transform IntegerFields to IntervalFields

    booking_begin = IntegerField(
        u"Buchungsbeginn (Tage)",
        description=u"Ab diesem Tag im Zeitraum wird ein Mitglied "
        u"als zahlungspflichtig angesehen.",
        validators=[InputRequired(), NumberRange(min=1)])

    booking_end = IntegerField(
        u"Buchungsende (Tage)",
        description=u"Bis zu diesem Tag im Zeitraum wird ein neues Mitglied "
        u"als zahlungspflichtig angesehen.",
        validators=[InputRequired(), NumberRange(min=1)])

    payment_deadline = IntegerField(
        u"Zahlungsfrist (Tage)",
        description=u"Bleibt ein Mitglied mehr Tage als hier angegeben eine "
        u"Zahlung schuldig, so wird es Mitglied in der "
        u"Zahlungsrückstands-Gruppe.",
        validators=[InputRequired(), NumberRange(min=0)])

    payment_deadline_final = IntegerField(
        u"Endgültige Zahlungsfrist (Tage)",
        description=u"Bleibt ein Mitglied mehr Tage als hier angegeben eine "
        u"Zahlung schuldig, so wird seine Mitgliedschaft beendet.",
        validators=[InputRequired(), NumberRange(min=0)])

    begins_on = DateField(u"Anfang",
                          validators=[DataRequired()],
                          today_btn=True,
                          today_highlight=True)
    ends_on = DateField(u"Ende",
                        validators=[DataRequired()],
                        today_btn=True,
                        today_highlight=True)
Ejemplo n.º 14
0
class UserSearchForm(Form):
    id = TextField(u"Nutzer-ID")
    name = TextField(u"Name")
    login = TextField(u"Unix-Login")
    mac = MacField(u"MAC-Adresse")
    ip_address = TextField(u"IP-Adresse")
    property_group_id = QuerySelectField(u"Eigenschaftsgruppe",
                                get_label='name',
                                query_factory=property_group_query,
                                allow_blank=True,
                                blank_text=u"<Eigenschaftsgruppe>")
    building_id = QuerySelectField(u"Wohnheim",
                                get_label='short_name',
                                query_factory=building_query,
                                allow_blank=True,
                                blank_text=u"<Wohnheim>")
    email = TextField("E-Mail")
    person_id = TextField("Debitorennummer")
Ejemplo n.º 15
0
class InterfaceForm(Form):
    name = TextField("Name",
                     description="z.B. eth0, en0 oder enp0s29u1u1u5",
                     validators=[Optional()])
    mac = MacField("MAC", [MacAddress(message="MAC ist ungültig!"), UniqueMac(annex_field=None)])
    ips = SelectMultipleField("IPs", validators=[Optional()])
Ejemplo n.º 16
0
class LoginForm(Form):
    login = TextField()
    password = PasswordField()
Ejemplo n.º 17
0
class BuildingForm(Form):
    short_name = TextField(u"Kürzel")
    number = TextField(u"Nummer")
    street = TextField(u"Straße", validators=[Length(min=5)])
Ejemplo n.º 18
0
class HostForm(SelectRoomForm):
    owner_id = UserIDField("Besitzer-ID")
    name = TextField("Name", validators=[Optional()],
                     description="z.B. TP-LINK WR841, FritzBox 4040 oder MacBook")

    _order = ("name", "owner_id")