You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.1 KiB

9 years ago
from django.contrib import admin
9 years ago
from .models import Member
8 years ago
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import UserChangeForm
class MemberChangeForm(UserChangeForm):
class Meta(UserChangeForm.Meta):
model = Member
class MemberAdmin(UserAdmin):
form = MemberChangeForm
fieldsets = fieldsets = (
(None, {'fields': ('email', 'password')}),
('Personal info', {'fields': ('first_name', 'last_name')}),
('Permissions', {'fields': ('is_active', 'is_superuser',
'groups', 'user_permissions')}),
('Important dates', {'fields': ('last_login',)}),
)
add_fieldsets = (
(None, {
'classes': ('wide',),
'fields': ('email', 'password1', 'password2'),
}),
)
ordering = ('email',)
list_display = ('email', 'first_name', 'last_name')
list_filter = ('is_superuser', 'is_active', 'groups')
search_fields = ('email', 'first_name', 'last_name', 'email')
9 years ago
9 years ago
# Register your models here.
8 years ago
admin.site.register(Member, MemberAdmin)