mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
core: use more AJAX forms in admin UI
Signed-off-by: Skia <skia@libskia.so>
This commit is contained in:
parent
c0b3024cc2
commit
30f650ecce
@ -28,11 +28,27 @@ from core.models import User, Page, RealGroup, SithFile
|
||||
from django.contrib.auth.models import Group as AuthGroup
|
||||
|
||||
|
||||
admin.site.register(User)
|
||||
admin.site.unregister(AuthGroup)
|
||||
admin.site.register(RealGroup)
|
||||
admin.site.register(Page)
|
||||
|
||||
@admin.register(User)
|
||||
class UserAdmin(admin.ModelAdmin):
|
||||
form = make_ajax_form(User, {
|
||||
'godfathers': 'users',
|
||||
'home': 'files', # ManyToManyField
|
||||
'profile_pict': 'files', # ManyToManyField
|
||||
'avatar_pict': 'files', # ManyToManyField
|
||||
'scrub_pict': 'files', # ManyToManyField
|
||||
})
|
||||
|
||||
@admin.register(Page)
|
||||
class PageAdmin(admin.ModelAdmin):
|
||||
form = make_ajax_form(Page, {
|
||||
'lock_user': 'users',
|
||||
'owner_group': 'groups',
|
||||
'edit_groups': 'groups',
|
||||
'view_groups': 'groups',
|
||||
})
|
||||
|
||||
@admin.register(SithFile)
|
||||
class SithFileAdmin(admin.ModelAdmin):
|
||||
|
Loading…
Reference in New Issue
Block a user