from django import forms from .models import Helper def text_input(type=None): attrs = {"class": "input"} if type != None: attrs["type"] = type return forms.TextInput(attrs=attrs) class RegisterForm(forms.Form): name = forms.CharField( max_length=Helper.name.field.max_length, label="Name", widget=text_input() ) # actually verify phone number, lol phone = forms.CharField( max_length=Helper.phone.field.max_length, label="Handynummer für Benachrichtigungen", help_text="Wir nutzen deine Handynummer, um dir Benachrichtigungen zu deinen Schichten zu schicken. Wir löschen alle Daten 7 Tage nach dem Festival.", widget=text_input("tel"), ) okf = forms.BooleanField(label="Ich bin damit einverstanden, SMS zu erhalten.") # placeholder form for simple submit button use cases so we get csrf protection class EmptyForm(forms.Form): pass