I have a Django form that looks like this:
class myForm(forms.Form):
email = forms.EmailField(
label="Email",
max_length=254,
required=True,
)
I have a an associated Class-Based FormView as shown below. I can see that the form is succesfully validating the data and flow is getting into the form_valid() method below. What I need to know is how to get the value that the user submitted in the email field. form.fields['email'].value
doesn't work.
class myFormView(FormView):
template_name = 'myTemplate.html'
form_class = myForm
success_url = "/blahblahblah"
def form_valid(self, form):
# How Do I get the submitted values of the form fields here?
# I would like to do a log.debug() of the email address?
return super(myFormView, self).form_valid(form)