forked from guohongze/adminset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.py
42 lines (31 loc) · 917 Bytes
/
admin.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
from models import Host, HostGroup, IpSource, Idc, InterFace, UserInfo
class HostAdmin(admin.ModelAdmin):
list_display = [
'hostname',
'ip',
'vendor',
'os',
'cpu_model',
'cpu_num',
'sn',
#'identity',
]
class HostGroupAdmin(admin.ModelAdmin):
list_display = ['name',]
class IpAdmin(admin.ModelAdmin):
list_display = ['net',]
class IdcAdmin(admin.ModelAdmin):
list_display = ['name',
'address',
]
class InterFaceAdmin(admin.ModelAdmin):
list_display = ['name',]
admin.site.register(Host, HostAdmin)
admin.site.register(IpSource, IpAdmin)
admin.site.register(Idc, IdcAdmin)
admin.site.register(InterFace, InterFaceAdmin)
admin.site.register(HostGroup, HostGroupAdmin)
admin.site.register(UserInfo)