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

4
from .models import IpType, Machine, MachineType, Alias, 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 23 24
class MxAdmin(VersionAdmin):
    list_display = ('zone', 'priority', 'name')

class NsAdmin(VersionAdmin):
    list_display = ('zone', 'interface')

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','dns','mac_address','ipv4','details')
chirac's avatar
chirac committed
30

31
class AliasAdmin(VersionAdmin):
chirac's avatar
chirac committed
32
    list_display = ('interface_parent', 'alias', 'extension')
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)
42
admin.site.register(Alias, AliasAdmin)