Sunday, April 15, 2012

Problems extracting valid form data lately

The following code extracts the user info from a registration page on
my Django site.
Lately it isn't extracting the different fields from
form.cleaned_data. When
I print cd["username"] (i.e. form.cleaned_data["username"]) it
gives the ENTIRE
form.cleaned_data dict!?!?! Why can't I extract elements from the
cleaned_data dict anymore?

if form.is_valid():
cd = form.cleaned_data
user = USER(username = cd["username"],
password = "",
email =
cd["parental_email_address"],
first_name =
cd["student_first_name"],
last_name =
cd["student_last_name"])
user.set_password(cd["password"])
user.save()


chris

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate