admin.py 797 Bytes
Newer Older
Dalahro's avatar
Dalahro committed
1
from django.contrib import admin
2
from reversion.admin import VersionAdmin
Dalahro's avatar
Dalahro committed
3

4
from .models import Machine, MachineType, IpList, Interface, Extension
Dalahro's avatar
Dalahro committed
5

6
class MachineAdmin(VersionAdmin):
chirac's avatar
chirac committed
7
    list_display = ('user','name','active')
Dalahro's avatar
Dalahro committed
8

9
class MachineTypeAdmin(VersionAdmin):
10
    list_display = ('type','extension','need_infra')
11

12
class ExtensionAdmin(VersionAdmin):
13
    list_display = ('name',)
Dalahro's avatar
Dalahro committed
14

15
class IpListAdmin(VersionAdmin):
16
    list_display = ('ipv4','ip_type')
chirac's avatar
chirac committed
17

18
class InterfaceAdmin(VersionAdmin):
chirac's avatar
chirac committed
19
    list_display = ('machine','type','dns','mac_address','ipv4','details')
chirac's avatar
chirac committed
20

Dalahro's avatar
Dalahro committed
21 22
admin.site.register(Machine, MachineAdmin)
admin.site.register(MachineType, MachineTypeAdmin)
23
admin.site.register(Extension, ExtensionAdmin)
chirac's avatar
chirac committed
24 25
admin.site.register(IpList, IpListAdmin)
admin.site.register(Interface, InterfaceAdmin)