mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-23 00:01:16 +00:00
improve admin
This commit is contained in:
parent
0342eb8214
commit
0ce73db818
@ -20,6 +20,17 @@ from club.models import Club, Membership
|
||||
@admin.register(Club)
|
||||
class ClubAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "unix_name", "parent", "is_active")
|
||||
search_fields = ("name", "unix_name")
|
||||
autocomplete_fields = (
|
||||
"parent",
|
||||
"board_group",
|
||||
"members_group",
|
||||
"view_groups",
|
||||
"edit_groups",
|
||||
"owner_group",
|
||||
"home",
|
||||
"page",
|
||||
)
|
||||
|
||||
|
||||
@admin.register(Membership)
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.models import Group as AuthGroup
|
||||
from django.contrib.auth.models import Permission
|
||||
|
||||
from core.models import Group, OperationLog, Page, SithFile, User
|
||||
|
||||
@ -26,6 +27,7 @@ class GroupAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "description", "is_manually_manageable")
|
||||
list_filter = ("is_manually_manageable",)
|
||||
search_fields = ("name",)
|
||||
autocomplete_fields = ("permissions",)
|
||||
|
||||
|
||||
@admin.register(User)
|
||||
@ -37,10 +39,17 @@ class UserAdmin(admin.ModelAdmin):
|
||||
"profile_pict",
|
||||
"avatar_pict",
|
||||
"scrub_pict",
|
||||
"user_permissions",
|
||||
"groups",
|
||||
)
|
||||
search_fields = ["first_name", "last_name", "username"]
|
||||
|
||||
|
||||
@admin.register(Permission)
|
||||
class PermissionAdmin(admin.ModelAdmin):
|
||||
search_fields = ("codename",)
|
||||
|
||||
|
||||
@admin.register(Page)
|
||||
class PageAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "_full_name", "owner_group")
|
||||
|
Loading…
Reference in New Issue
Block a user