Forms and Widgets

Signup form

Emails

Addresses

Address
Address
Address
Source code

Python

class SignupForm(Form):
    username = forms.CharField(
        max_length=50,
        widget=forms.TextInput(attrs={"leading-icon": "account_box"}),
    )
    first_name = forms.CharField(max_length=250)
    last_name = forms.CharField(max_length=250)
    date_of_birth = forms.DateField()
    emails = FormSetField(formset_class=EmailFormSet)
    addresses = FormSetField(formset_class=AddressFormSet)

    layout = Layout(
        "username",
        Row("first_name", "last_name", "date_of_birth"),
        "emails",
        FormSet("addresses", card_desktop=4),
    )