Hello. I have:

def save_profile(request):

        if request.user.is_authenticated():
                if request.method == 'POST':
                        try:
                                profile_obj = 
Profile.objects.get(user__exact=request.user)
                                ProfileForm = 
forms.form_for_instance(profile_obj,
fields=('regnum','pvnnum','jaddress','paddress','bank','swift','account','contactperson','phone','mail','url'))
                                profile_form = ProfileForm(request.POST)
                        except Profile.DoesNotExist:
                                ProfileForm = forms.form_for_model(Profile)
                                profile_form = ProfileForm()
                                # how to do THIS?: profile_form['user'] = 
request.user
                        
                        if profile_form.is_valid():
                                profile_form.save()
                                return profile(request)
        return HttpResponseRedirect('/')


-----------------
how can I modify a field value in the form? I know it's name('user'),
but I can't figure out how to do it... thanks

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to