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

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

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

class MachineTypeAdmin(admin.ModelAdmin):
9 10 11 12
    list_display = ('type','extension')

class ExtensionAdmin(admin.ModelAdmin):
    list_display = ('name',)
Dalahro's avatar
Dalahro committed
13

chirac's avatar
chirac committed
14 15 16 17
class IpListAdmin(admin.ModelAdmin):
    list_display = ('ipv4',)

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

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