admin.py 1.29 KB
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, Domain, IpList, Interface, Extension, Mx, Ns
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):
guimoz's avatar
guimoz committed
10
    list_display = ('type','extension','need_infra','domaine_ip','domaine_range')
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','origin')
Dalahro's avatar
Dalahro committed
18

19 20 21 22
class MxAdmin(VersionAdmin):
    list_display = ('zone', 'priority', 'name')

class NsAdmin(VersionAdmin):
Gabriel Detraz's avatar
Gabriel Detraz committed
23
    list_display = ('zone', 'ns')
24

25
class IpListAdmin(VersionAdmin):
26
    list_display = ('ipv4','ip_type')
chirac's avatar
chirac committed
27

28
class InterfaceAdmin(VersionAdmin):
chirac's avatar
chirac committed
29
    list_display = ('machine','type','mac_address','ipv4','details')
chirac's avatar
chirac committed
30

chirac's avatar
chirac committed
31 32
class DomainAdmin(VersionAdmin):
    list_display = ('interface_parent', 'name', 'extension', 'cname')
33

Dalahro's avatar
Dalahro committed
34 35
admin.site.register(Machine, MachineAdmin)
admin.site.register(MachineType, MachineTypeAdmin)
chirac's avatar
chirac committed
36
admin.site.register(IpType, IpTypeAdmin)
37
admin.site.register(Extension, ExtensionAdmin)
38 39
admin.site.register(Mx, MxAdmin)
admin.site.register(Ns, NsAdmin)
chirac's avatar
chirac committed
40 41
admin.site.register(IpList, IpListAdmin)
admin.site.register(Interface, InterfaceAdmin)
chirac's avatar
chirac committed
42
admin.site.register(Domain, DomainAdmin)