On 12/29/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

I just recently started out working with newforms and they generally
seem to be a joy but I cannot seem to access form.clean_data... (I am
using the most recent dev. version)

I remember scratching my head over that too. form.clean_data is not
available until after you call form.is_valid() and only if
form.is_valid() returns true. Oh, and you need to get that from an
instance of the class, not from the class itself.

Additionaly, form.errors will always be empty if form.is_valid() is
true, so you don't need to test for both. Try these changes:

if request.method == 'POST':
                new_data = request.POST.copy()
                personal_form = UserPersonalForm(new_data, auto_id=True)
                contact_form = UserContactForm(new_data, auto_id=True)

                if personal_form.is_valid() and contact_form.is_valid() :
                        u.first_name = personal_form.clean_data['first_name']



--
----
Waylan Limberg
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to