I think I figured it out. The user is on the reuqest so it was pretty easy.
On Wednesday, January 22, 2014 9:48:27 AM UTC-5, Brad Rice wrote:
-- def form_valid(self, form):
obj = form.save(commit=False)
obj.created_by = self.request.user
obj.application_id = self.kwargs['app_id']
u = self.request.user
u.last_name = obj.last_name;
u.first_name = obj.first_name;
obj.save()
u.save()
#reverse_lazy = lambda name=answers, *args : lazy(reverse, str)(name, args=args)
return HttpResponseRedirect(reverse('requestform:answers', kwargs={'app_id': obj.application_id}))
On Wednesday, January 22, 2014 9:48:27 AM UTC-5, Brad Rice wrote:
I have a registration and login page that only takes username and password. After they register or login, they are taken to a profile form where they can provide additional information such as address and phone numbers. I'm using a Model Form CreateView there. On that page I want the First Name and Last Name fields to save to the auth_user table rather than that Profile Form model. How do I have two fields submit data to the auth_user table and the other fields submit to the Profile table?
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dcf1ea7c-92fb-405b-885d-9656c91d782f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment