Guest User

admin.py

a guest
Feb 19th, 2015
209
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from django.contrib import admin
  2. from gold.models import Post, UserProfile
  3. from django.contrib.auth.models import User
  4. from django.contrib.auth.admin import UserAdmin
  5. # Register your models here.
  6.  
  7. class UserProfileInline(admin.StackedInline):
  8.   model = UserProfile
  9.  
  10.  
  11. class UserAdmin(UserAdmin):
  12.     inlines = (UserProfileInline, )
  13.  
  14. admin.site.unregister(User)
  15. admin.site.register(Post)
  16. admin.site.register(User, UserAdmin)
RAW Paste Data