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

3
from .models import User, School, Right, ListRight
4 5 6 7 8 9 10

class UserAdmin(admin.ModelAdmin):
    list_display = ('name','surname','pseudo','email', 'school', 'state')

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')

17 18
admin.site.register(User, UserAdmin)
admin.site.register(School, SchoolAdmin)
19 20
admin.site.register(Right, RightAdmin)
admin.site.register(ListRight, ListRightAdmin)