class UserCreateForm(UserBaseDataForm, SelectRoomForm): birthdate = DateField(u"Geburtsdatum", [OptionalIf('mac', invert=True)]) mac = MacField(u"MAC", [Optional(), MacAddress(message=u"MAC ist ungültig!"), UniqueMac()]) property_groups = QuerySelectMultipleField(u"Gruppen", get_label='name', query_factory=property_group_user_create_query) annex = ConfirmCheckboxField(u"Host annektieren") force = ConfirmCheckboxField("* Hinweise ignorieren") _order = ("name", "building", "level", "room_number")
class UserMoveForm(SelectRoomForm): comment = TextAreaField( "Kommentar", description='Wenn gegeben Referenz zum Ticket', render_kw={ 'placeholder': 'ticket#<TicketNr> / <TicketNr> / ticket:<ticketId>' }) now = BooleanField("Sofort", default=False) when = DateField("Umzug am", [OptionalIf("now")]) when_time = TimeField("Genaue Zeit", [Optional()], description="Optional. In UTC angeben.", render_kw={'placeholder': 'hh:mm'}) def get_execution_time(self, now: datetime) -> datetime: if self.now.data: return now assert self.when.data, "`now` checkbox deselected but no date given!" return utc.combine_or_midnight(self.when.data, self.when_time.data)
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 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 UserMoveForm(SelectRoomForm): now = BooleanField(u"Sofort", default=False) when = DateField(u"Umzug am", [OptionalIf("now")])