Thanks to everyone here, this really helped me out.
One thing I still have questions about it Eric's remark:

> ---
> Take note that, since the is_superuser is not a required field, iirc,
> you don't have to set it in new_data if your intent leave the value the
> same.
> ---

I indeed want to keep the 'is_superuser' value the same. I assumed, as
you do, that such will be the case if you use a User.ChangeManipulator.
As I do in:

=======VIEW==========
userManipulator = User.ChangeManipulator(user.id)
origUser = userManipulator.original_object
if request.POST:
    new_data_user = request.POST.copy()
    errors = userManipulator.get_validation_errors(new_data_user)
    if not errors:
        userManipulator.do_html2python(new_data_user)
        updatedUser = userManipulator.save(new_data_user)
    else:
        return HttpResponse('Error: errors in user data: ' +
str(errors))
else:
    new_data_user = origUser.__dict__
userWrapperForm = FormWrapper(userManipulator, new_data_user, errors)
=====================

The userWrapperForm contains all the correct fields/values when I pass
it to the form. In the template's form I'm not showing all fields of
the userWrapperForm (since I don't want users to change those values).
The fields that are not mentioned in the template form are not sent
back when the form is submitted. This clears the original values.

It seems the template neglects all values that are not used in the form
and sets them to null/empty strings.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to