Created
July 13, 2012 19:58
-
-
Save mercutio22/3107029 to your computer and use it in GitHub Desktop.
Inline user profile not being displayed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
#from django.contrib.auth.admin import UserAdmin | |
from django.contrib.auth.models import User | |
from models import Profile | |
from baseapp.admin import StudentAdminInline | |
class ProfileAdmin(admin.ModelAdmin): | |
exclude = ('activation_key',) | |
class ProfileAdminInline(admin.StackedInline): | |
model = Profile | |
max_num = 1 | |
can_delete = False | |
exclude = ('activation_key',) | |
class CustomizedUserAdmin(admin.ModelAdmin): | |
model = User | |
inlines = [ProfileAdminInline] | |
exclude = ('first_name', 'last_name') | |
admin.site.unregister(User) | |
admin.site.register(User, CustomizedUserAdmin) | |
#dmin.site.register(Profile, ProfileAdmin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment