Thanks for the link. Since UserAdmin is not directly under my control I came 
up with the following solution:

from django.contrib.auth.admin import UserAdmin

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


class UserProfileInline(admin.StackedInline):
  model = UserProfile
  max_num = 1


class UserAndProfileAdmin(UserAdmin):
  inlines = [UserProfileInline, ]


admin.site.unregister(User)
admin.site.register(User, UserAndProfileAdmin)


is that the "best" solution?


Thanks,
Bernd Donner



On Sunday 20 July 2008 22:06:19 Adi J. Sieker wrote:
> On Sun, 20 Jul 2008 21:35:44 +0200, Bernd Donner <[EMAIL PROTECTED]>
>
> wrote:
> > In the old version of the admin site the fields of the UserProfile could
> > be
> > displayed "inline" on the corresponding User page of the admin site.
> > This was
> > done by somthing like:
> >
> > class UserProfile(models.Model):
> >   ...
> >   user = models.ForeignKey(User, unique=True, edit_inline=models.STACKED)
> >
> > How can the same effect be achieved with newforms-admin?
>
> The docs know all:
> http://www.djangoproject.com/documentation/admin/#inlinemodeladmin-objects
>
> That should probably help you.
>
> adi



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