admin.py 919 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

chirac's avatar
chirac committed
4
from .models import IpType, 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

chirac's avatar
chirac committed
9
class IpTypeAdmin(VersionAdmin):
10
    list_display = ('type','extension','need_infra')
11

chirac's avatar
chirac committed
12 13 14 15
class MachineTypeAdmin(VersionAdmin):
    list_display = ('type','ip_type')


16
class ExtensionAdmin(VersionAdmin):
17
    list_display = ('name',)
Dalahro's avatar
Dalahro committed
18

19
class IpListAdmin(VersionAdmin):
20
    list_display = ('ipv4','ip_type')
chirac's avatar
chirac committed
21

22
class InterfaceAdmin(VersionAdmin):
chirac's avatar
chirac committed
23
    list_display = ('machine','type','dns','mac_address','ipv4','details')
chirac's avatar
chirac committed
24

Dalahro's avatar
Dalahro committed
25 26
admin.site.register(Machine, MachineAdmin)
admin.site.register(MachineType, MachineTypeAdmin)
chirac's avatar
chirac committed
27
admin.site.register(IpType, IpTypeAdmin)
28
admin.site.register(Extension, ExtensionAdmin)
chirac's avatar
chirac committed
29 30
admin.site.register(IpList, IpListAdmin)
admin.site.register(Interface, InterfaceAdmin)