Skip to content

Instantly share code, notes, and snippets.

@mercutio22
Created July 13, 2012 19:58
Show Gist options
  • Save mercutio22/3107029 to your computer and use it in GitHub Desktop.
Save mercutio22/3107029 to your computer and use it in GitHub Desktop.
Inline user profile not being displayed
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