Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
Actually, it seems a bit redundant doesn't it? I see there is a get_profile, but nothing to set it anyway. I guess it's derived information from the database Yay! such simple solutions, I'm so happy to be able to register. On Dec 20, 9:42 am, DragonSlayre wrote: > You

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
You are gods - thank you. I did try something like this before, but being so noob at the technology, didn't assign the form to a new variable. Will i have to assign the profile in the user object as well? I assume I will. On Dec 20, 9:38 am, Daniel Roseman

Re: Problem saving a User object to a profile

2008-12-19 Thread nbv4
On Dec 19, 3:15 pm, DragonSlayre wrote: > profile_form.user = user; > profile_form.save() The problem is that you can't assign fields in forms directly like this. The only way to input data into a form is when you initially create the form object ala: profile_form =

Re: Problem saving a User object to a profile

2008-12-19 Thread Daniel Roseman
On Dec 19, 8:28 pm, nbv4 wrote: > On Dec 19, 3:15 pm, DragonSlayre wrote: > > > profile_form.user = user; > > profile_form.save() > > The problem is that you can't assign fields in forms directly like > this. The only way to input data into a form is when

Re: Problem saving a User object to a profile

2008-12-19 Thread Adi Sieker
Hi, On 19.12.2008, at 21:15, DragonSlayre wrote: > > I've got a profile model which has a django.contrib.auth.models.User > as a foreign key. > > I am trying to assign the User object to my profile model after I've > checked that the user is valid and that the profile contents are also > valid.

Re: Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
Ok - I'm digging deeper, and I realise that my form doesn't have a user, as it's excluded from the form using exclude = ('user'). I'll carry on looking... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Problem saving a User object to a profile

2008-12-19 Thread DragonSlayre
I've got a profile model which has a django.contrib.auth.models.User as a foreign key. I am trying to assign the User object to my profile model after I've checked that the user is valid and that the profile contents are also valid. Once I've saved my user object, I then call profile_form.user