On Tue, Dec 9, 2008 at 8:58 PM, mahesh <[EMAIL PROTECTED]> wrote:
> How do wire Userprofile to UserAdmin ?
Here's one way to do it:
# admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from myproj.myapp.models import UserProfile
class UserProfileAdminInline(admin.TabularInline):
model = UserProfile
class NewUserAdmin(UserAdmin):
inlines = [UserProfileAdminInline]
admin.site.unregister(User)
admin.site.register(User, NewUserAdmin)
Ronny
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---