it's ok how u get user into save function. There is also other way to it(if
u'll need something also in clean methods)

-in view function
form=WTForm()
form.user = user
if form.is_valid():
   ....

-in form
class WTForm(forms.Form):
   user = none
   ....
   ....
                and u can get user as self.user.


Don't thank me, you solved everything by youself and that's the way how to
learn (if someone would give you whole code, you would miss lot
information). Also you solved initialization of the form. Similar way to do
it:
form=WTForm(initial={'field':value, 'field':value})


Good luck with project :-)

R.



erdmaennchen wrote:
> 
> 
> I don't know if this is the best way to pre-populate a form, but I
> changed my view so it takes now a data dictionnary. It works :-)
> 
> data = {
>             'first_name':user_obj.first_name,
>             'last_name':user_obj.last_name,
>             'gender':profile_obj.gender,
>             'birthdate':profile_obj.birthdate,
>             'country':profile_obj.country,
>             'city':profile_obj.city
>         }
>         form = form_class(data)
> 
> @ MikeKJ: Maybe it works for you to (just defining your own
> forms.Form). My example code should help.
> 
> Thanks for all your help (especially to you, urukay)!
> 
> Best regards,
> Alex
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/General-question%3A-Django-Profiles%2C-auth.User-and-%22merging%22-both-data-tp20458575p20495566.html
Sent from the django-users mailing list archive at Nabble.com.


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