admin.py 885 Bytes
Newer Older
lhark's avatar
lhark committed
1 2
from django.contrib import admin

chirac's avatar
chirac committed
3
from .models import User, School, Right, ListRight, Ban, Whitelist
4 5

class UserAdmin(admin.ModelAdmin):
6
    list_display = ('name','surname','pseudo','room','email', 'school', 'state')
7 8 9 10

class SchoolAdmin(admin.ModelAdmin):
    list_display = ('name',)

11 12 13 14 15 16
class ListRightAdmin(admin.ModelAdmin):
    list_display = ('listright',)

class RightAdmin(admin.ModelAdmin):
    list_display = ('user', 'right')

chirac's avatar
chirac committed
17 18 19
class BanAdmin(admin.ModelAdmin):
    list_display = ('user', 'raison', 'date_start', 'date_end')

chirac's avatar
chirac committed
20 21 22
class WhitelistAdmin(admin.ModelAdmin):
    list_display = ('user', 'raison', 'date_start', 'date_end')

23 24
admin.site.register(User, UserAdmin)
admin.site.register(School, SchoolAdmin)
25 26
admin.site.register(Right, RightAdmin)
admin.site.register(ListRight, ListRightAdmin)
chirac's avatar
chirac committed
27
admin.site.register(Ban, BanAdmin)
chirac's avatar
chirac committed
28
admin.site.register(Whitelist, WhitelistAdmin)