[Answer]-Excluding foreign key fields from django forms

1👍

Just add address in exclude list

class CreateRegUserForm(forms.ModelForm):
    confirm_email = forms.EmailField(
        label="Confirm email",
        required=True,
    )

    class Meta:
        model = RegisteredUser
        exclude = ('address','password','last_login','is_superuser','is_staff','is_active','date_joined','registered_date','address_id',)

Leave a comment