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 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")
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 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()])