Was there any solution to this?  I'm looking through the tickets,
wiki, docs, web, and now the source trying to figure out how to get my
profile data saved along with a User in the admin.  Anyone have that
working?   My situation is the same as this poster's, except I don't
get any error; I just get no profile record created.

If I create a new user, no profile record is created in the DB.

Incidentally, my profile model has one field which is a ForeignKey.

class UserProfile(models.Model):
    country = models.ForeignKey(Country, core=True)
    user = models.ForeignKey(User, unique=True,
edit_inline=models.TABULAR)

Thanks!

---------- Forwarded message ----------
From: "Johan Liseborn" <[EMAIL PROTECTED]>
Date: Feb 28, 5:02 am
Subject: User Profile in Admin interface (using trunk)
To: Django users


I don't know if I am missing the obvious, or if what I am trying to do
really is complicated in some way. I've tried to search the archives
and the web at large, and I have found a number of references to the
problem, and even some suggestions on how to do it (most dating from
2006 and 2007), but none of them seems to work for me now.

Anyway, what I would like to do is this: I have made an extension to
the User model using theProfileframework, and now I would like to be
able to edit theprofiledata together with the other user data in
Django'sadmininterface.

The most promising thing I have found suggests doing something along
the lines of:

classProfile(models.Model):
    # This field is required for theProfileto work...
    user = models.ForeignKey(User, unique=True,

edit_inline=models.TABULAR,
                                                               
num_in_admin=1,

min_num_in_admin=1,

max_num_in_admin=1,

num_extra_on_change=0)

    # The following fields are our additions...
    foo = models.CharField(max_length=20, unique=True, core=True)

Using the above code makes theprofileappear under the user data in
theadmininterface, but when I try tosavea user I get the following
error:

"Cannot resolve keyword 'foo' into field. Choices are: groups,
user_permissions, task, logentry, message,profile, note, client_set,
manager_set, id, username, first_name, last_name, email, password,
is_staff, is_active, is_superuser, last_login, date_joined"

Myprofileworks in other parts of the application, so I am fairly
sure I have set the AUTH_PROFILE_MODULE correctly.

I am running trunk.

Is what I am trying supposed to work? Is there another way to do it?

Cheers,

johan

--
Johan Liseborn

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