class UserCreateForm(SelectRoomFormOptional): name = TextField(u"Name", [DataRequired(message=u"Name wird benötigt!")]) 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]) birthdate = DateField(u"Geburtsdatum", [OptionalIf('mac', invert=True)]) mac = MacField(u"MAC", [MacAddress(message=u"MAC ist ungültig!"), Optional()]) property_groups = QuerySelectMultipleField( u"Gruppen", get_label='name', query_factory=property_group_user_create_query) annex = BooleanField(u"Host annektieren", [Optional()]) force = BooleanField(u"* Hinweise ignorieren", [Optional()]) _order = ("name", "building", "level", "room_number")
class BankAccountActivitiesImportForm(Form): account = SelectField(u"Bankkonto", coerce=int) user = StringField(u"Loginname", validators=[DataRequired()]) pin = PasswordField(u"PIN", validators=[DataRequired()]) start_date = DateField(u"Startdatum") end_date = DateField(u"Enddatum") do_import = BooleanField(u"Import durchführen", default=False)
class UserAddGroupMembership(Form): group_id = QuerySelectField(u"Gruppe",get_label='name',query_factory=group_query) begin_date = DateField( u"Beginn", [Required()], default=datetime.now, today_btn=True, today_highlight=True) unlimited = BooleanField(u"Unbegrenzte Dauer", default=False) end_date = DateField(u"Ende", today_btn=True, today_highlight=True)
class RoomForm(Form): number = TextField(u"Nummer") level = TextField(u"Etage") inhabitable = BooleanField(u"Bewohnbar") dormitory_id = QuerySelectField(u"Wohnheim", get_label='short_name', query_factory=dormitory_query)
class UserMoveInForm(UserMoveForm): mac = TextField(u"MAC", [Regexp(regex=mac_regex, message=u"MAC ist ungültig!")]) birthdate = DateField( u"Geburtsdatum", [DataRequired(message=u"Geburtsdatum wird benötigt!")]) begin_membership = BooleanField(u"Mitgliedschaft beginnen", [Optional()])
class UserCreateForm(UserMoveForm): name = TextField(u"Name", [DataRequired(message=u"Name wird benötigt!")]) login = TextField(u"Login", [ DataRequired(message=u"Login wird benötigt!"), Regexp(regex=User.login_regex, message=u"Login ist ungültig!"), validate_unique_login ]) email = TextField(u"E-Mail", [Email(message=u"E-Mail ist ungueltig!"), Optional()], filters=[empty_to_none]) mac = TextField(u"MAC", [ OptionalIf('room_number', invert=True), Regexp(regex=mac_regex, message=u"MAC ist ungültig!") ]) birthdate = DateField( u"Geburtsdatum", [DataRequired(message=u"Geburtsdatum wird benötigt!")]) property_group = QuerySelectField(u"Gruppe", get_label='name', query_factory=property_group_query) annex = BooleanField(u"Host annektieren", [Optional()]) force = BooleanField(u"* Hinweise ignorieren", [Optional()])
class UserMoveForm(SelectRoomForm): now = BooleanField(u"Sofort", default=False) when = DateField(u"Umzug am", [OptionalIf("now")]) pass
class UserMoveOutForm(Form): now = BooleanField(u"Sofort", default=False) when = DateField(u"Auszug am", [OptionalIf("now")]) comment = TextAreaField(u"Kommentar") end_membership = BooleanField(u"Mitgliedschaft/Extern beenden", [Optional()])
class UserSuspendForm(Form): ends_at = FormField(OptionallyUnlimitedEndDateForm) reason = TextAreaField(u"Grund", [DataRequired()]) violation = BooleanField("Verstoß")
class OptionallyUnlimitedEndDateForm(Form): unlimited = BooleanField(u"Unbegrenzte Dauer", default=False) date = DateField(u"Ende", [OptionalIf("unlimited")])
class OptionallyDirectBeginDateForm(Form): now = BooleanField(u"Sofort", default=False) date = DateField(u"Beginn", [OptionalIf("now")])
class UserMoveInForm(UserMoveForm): now = BooleanField(u"Sofort", default=False) when = DateField(u"Einzug am", [OptionalIf("now")]) birthdate = DateField(u"Geburtsdatum", [OptionalIf('mac', invert=True)]) mac = MacField(u"MAC", [Optional()]) begin_membership = BooleanField(u"Mitgliedschaft beginnen", [Optional()])
class FixMT940Form(Form): mt940 = TextAreaField(u'MT940') do_import = BooleanField(u"Import durchführen", default=False)
class UserBlockForm(Form): unlimited = BooleanField(u"Unbegrenzte Sperrung", default=False) date = DateField( u"Gesperrt bis", default=datetime.now, today_btn=True, today_highlight=True) reason = TextAreaField(u"Grund")
class UserEditGroupMembership(Form): begin_date = DateField( u"Beginn", [Required()], default=datetime.now, today_btn=True, today_highlight=True) unlimited = BooleanField(u"Unbegrenzte Mitgliedschaft", default=False) end_date = DateField(u"Ende", today_btn=True, today_highlight=True)
class UserMoveOutForm(Form): # when = DateField(u"Auszug am", [DataRequired()]) comment = TextAreaField(u"Kommentar") end_membership = BooleanField(u"Mitgliedschaft/Extern beenden", [Optional()])