On Wed, Jun 22, 2011 at 08:28, raj <nano.ri...@gmail.com> wrote:
> I'm trying to create an update_profile form. This form will be able to
> update extended user information that is not in the original form.
>
> So, I have a form that allows you to create an account. There a lot of
> other fields that aren't listed in this form. The rest of these fields
> will be found when the user actually logs in. What I can't figure out
> is how to make the class that allows them to update this information.
> Like in the extended user class that I made, I have a save function
> that creates a user and saves it. But I don't want to create another
> user with this form. I simply want to update the current authenticated
> user. I thought there would be an update_user type function in the
> UserManager(), but there isn't. I tried googling and didn't come up
> with much. Help Please?

I don't quite understand what you mean...

When you say load the url: /userprofile/1234/ at got your urls.py to
get <id> from the URL.
Then you could load that userprofile from the db with e.g.

def a_nice_view(request, id):
from django.auth.models import User
userprofile = User.objects.get(pk=id)
## Then do updating on that profile here ##
userprofile.username = "Somethingnew"

It's the same way with a form/request, and you can get the userprofile
with: request.user

All this is pretty basic stuff, and as I've seen you ask a lot of
these questions on django-users I would really advise you to read a
introductory book or do some more tutorials before trying to make
something advanced yourselves.

-- 
With regards, Herman Schistad

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to