Browse Source

Update available models in admin site.

feature/python-error-tracking
Drew Larson 8 years ago
parent
commit
0745279c12
  1. 72
      bikeshop_project/registration/admin.py

72
bikeshop_project/registration/admin.py

@ -1,34 +1,38 @@
# from django.contrib import admin from django.contrib import admin
# from .models import CustomUser from .models import CustomUser, Member
# from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin
# from django.contrib.auth.forms import UserChangeForm from django.contrib.auth.forms import UserChangeForm
#
#
# class CustomUserChangeForm(UserChangeForm): class CustomUserChangeForm(UserChangeForm):
# class Meta(UserChangeForm.Meta): class Meta(UserChangeForm.Meta):
# model = CustomUser model = CustomUser
#
#
# class CustomUserAdmin(UserAdmin): @admin.register(CustomUser)
# form = CustomUserChangeForm class CustomUserAdmin(UserAdmin):
# form = CustomUserChangeForm
# fieldsets = (
# (None, {'fields': ('email', 'password')}), fieldsets = (
# ('Permissions', {'fields': ('is_active', 'is_superuser', (None, {'fields': ('email', 'password')}),
# 'groups', 'user_permissions')}), ('Permissions', {'fields': ('is_active', 'is_superuser',
# ('Important dates', {'fields': ('last_login',)}), 'groups', 'user_permissions')}),
# ) ('Important dates', {'fields': ('last_login',)}),
# add_fieldsets = ( )
# (None, { add_fieldsets = (
# 'classes': ('wide',), (None, {
# 'fields': ('email', 'password1', 'password2'), 'classes': ('wide',),
# }), 'fields': ('email', 'password1', 'password2'),
# ) }),
# ordering = ('email',) )
# list_display = ('email',) ordering = ('email',)
# list_filter = ('is_superuser', 'is_active', 'groups') list_display = ('email',)
# search_fields = ('email',) list_filter = ('is_superuser', 'is_active', 'groups')
# search_fields = ('email',)
#
# # Register your models here.
# admin.site.register(CustomUser, CustomUserAdmin) @admin.register(Member)
class MemberAdmin(admin.ModelAdmin):
list_display = ('get_full_name',)
ordering = ('last_name',)
search_fields = ('email', 'first_name', 'last_name')
Loading…
Cancel
Save