<s> from django . contrib import admin <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from django . contrib . auth . admin import UserAdmin <EOL> try : <EOL> from django . utils . encoding import force_text <EOL> except ImportError : <EOL> from django . utils . encoding import force_unicode as force_text <EOL> from . models import DemoUser , UserProfile <EOL> from . forms import DemoUserAdminForm <EOL> class UserProfileAdmin ( admin . ModelAdmin ) : <EOL> search_fields = ( '<STR_LIT:user>' , '<STR_LIT>' ) <EOL> ordering = ( '<STR_LIT:user>' , ) <EOL> list_select_related = ( '<STR_LIT:user>' , ) <EOL> admin . site . register ( UserProfile , UserProfileAdmin ) <EOL> class UserProfileAdminInline ( admin . TabularInline ) : <EOL> model = UserProfile <EOL> class DemoUserAdmin ( UserAdmin ) : <EOL> """<STR_LIT>""" <EOL> inlines = [ <EOL> UserProfileAdminInline , <EOL> ] <EOL> fieldsets = ( <EOL> ( None , { '<STR_LIT>' : ( '<STR_LIT:email>' , '<STR_LIT:password>' ) } ) , <EOL> ( _ ( '<STR_LIT>' ) , { '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) } ) , <EOL> ( _ ( '<STR_LIT>' ) , { '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) } ) , <EOL> ( _ ( '<STR_LIT>' ) , { '<STR_LIT>' : ( '<STR_LIT>' , '<STR_LIT>' ) } ) , <EOL> ) <EOL> add_fieldsets = ( <EOL> ( None , { <EOL> '<STR_LIT>' : ( '<STR_LIT>' , ) , <EOL> '<STR_LIT>' : ( '<STR_LIT:email>' , '<STR_LIT>' , '<STR_LIT>' ) } <EOL> ) , <EOL> ) <EOL> list_display = ( '<STR_LIT:email>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> search_fields = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:email>' ) <EOL> ordering = ( '<STR_LIT:email>' , ) <EOL> form = DemoUserAdminForm <EOL> admin . site . register ( DemoUser , DemoUserAdmin ) </s>
