admin.py 722 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
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')

20 21
admin.site.register(User, UserAdmin)
admin.site.register(School, SchoolAdmin)
22 23
admin.site.register(Right, RightAdmin)
admin.site.register(ListRight, ListRightAdmin)
chirac's avatar
chirac committed
24
admin.site.register(Ban, BanAdmin)