mpeltriaux
ef65869c7c
* refactors django User model to custom User model to provide further attributes and methods directly on the user model
35 lines
697 B
Python
35 lines
697 B
Python
from django.contrib import admin
|
|
|
|
from user.models import UserNotification, UserActionLogEntry, User
|
|
|
|
|
|
class UserNotificationAdmin(admin.ModelAdmin):
|
|
list_display = [
|
|
"id",
|
|
"name",
|
|
"is_active",
|
|
]
|
|
|
|
|
|
class UserAdmin(admin.ModelAdmin):
|
|
list_display = [
|
|
"id",
|
|
"username",
|
|
"first_name",
|
|
"last_name",
|
|
"email",
|
|
]
|
|
|
|
|
|
class UserActionLogEntryAdmin(admin.ModelAdmin):
|
|
list_display = [
|
|
"id",
|
|
"user",
|
|
"timestamp",
|
|
"action",
|
|
]
|
|
|
|
|
|
admin.site.register(UserNotification, UserNotificationAdmin)
|
|
admin.site.register(UserActionLogEntry, UserActionLogEntryAdmin)
|
|
admin.site.register(User, UserAdmin) |