Tuesday, October 26, 2010

Displaying Profile model in a form

I am relatively new to django. I've been reading the docs endlessly
and hacking to try to get something to work, but I'm hoping to not re-
create functionality that either exists or is part of the framework.

I have a class named UserProfile that I'd like to use to extend the
User object. I set it up properly within settings.py and have verified
from the shell that everything works.

I'm trying to display a form that has both the UserProfile fields and
a select handful of the User fields.
What's the best way to go about doing this? In the CreateUserForm that
I'm creating, I have an inner Meta class with the 'model' = User, but
of course that won't display the UserProfile fields. If I switch it to
UserProfile, it won't display the User fields. I could re-create each
of the UserProfile fields in the form, but that wouldn't be very DRY.
On top of that, I'd have to handle the cascading commit and
transactions myself if I manually handled the UserProfile and User
objects separately. I'm hoping the framework has something and I just
missed it?

Please help...
Thanks in advance!

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate