admin.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. from django.contrib import admin
  2. from import_export.admin import ImportExportModelAdmin
  3. from .models import *
  4. @admin.register(PIC)
  5. class PICAdmin(ImportExportModelAdmin):
  6. list_display = ('PIC_Nom_netbios', 'PIC_Utilisateur', 'PIC_NUnic', 'PIC_L_Statut', 'PIC_Site', 'PIC_Service', 'PIC_L_Chassi_Type')
  7. list_filter = ('PIC_Site', 'PIC_Deg', 'PIC_L_Chassi_Type', 'PIC_L_Statut', 'PIC_Service','PIC_CPU','PIC_RAM')
  8. search_fields = ['PIC_Nom_netbios', 'PIC_Adresse_IP', 'PIC_Utilisateur', 'PIC_Service__SERVICE_Nom', 'PIC_Service__SERVICE_Anag','PIC_Precisions']
  9. exclude =('PIC_L_Service',)
  10. pass
  11. @admin.register(VLAN)
  12. class VLANAdmin(admin.ModelAdmin):
  13. list_display = ('VLAN_Nom', 'VLAN_Site', 'VLAN_IN', 'VLAN_Des', 'VLAN_Plag', 'VLAN_Route')
  14. pass
  15. @admin.register(PIC_History)
  16. class PIC_HistoryAdmin(admin.ModelAdmin):
  17. list_display = ('H_PIC', 'H_Date', 'H_Commentaire')
  18. pass
  19. @admin.register(PIS)
  20. class PISAdmin(ImportExportModelAdmin):
  21. list_display = ('PIS_Site', 'PIS_Localisation','PIS_Nom_netbios','PIS_Friendly_Name', 'PIS_Type', 'PIS_Role', 'PIS_Adresse_IP', 'PIS_Commentaires')
  22. list_filter = ('PIS_Site', 'PIS_Type', 'PIS_Archive', 'PIS_Role')
  23. search_fields = ['PIS_Nom_netbios', 'PIS_Role', 'PIS_Adresse_IP','PIS_Localisation', 'PIS_Commentaires']
  24. pass
  25. @admin.register(Swich)
  26. class SwichAdmin(ImportExportModelAdmin):
  27. list_display = ('SW_Baie','SW_Nom', 'SW_IP', 'SW_OS', 'SW_TYPE')
  28. list_filter = ('SW_Baie__BAIE_Site_NG','SW_Baie', 'SW_OS', 'SW_TYPE')
  29. search_fields = ['SW_Baie', 'SW_Nom','SW_IP', 'SW_Commentaires']
  30. pass
  31. @admin.register(Port_Link)
  32. class Port_LinkAdmin(admin.ModelAdmin):
  33. list_display = ('PL_Swich', 'PL_Port_NG', 'PL_VLAN', 'PL_Headbang_plug', 'PL_Commentaires')
  34. pass
  35. @admin.register(Baie)
  36. class BaieAdmin(admin.ModelAdmin):
  37. list_display = ('BAIE_Site_NG', 'BAIE_Nom', 'BAIE_Local')
  38. pass
  39. @admin.register(Accessory_Link)
  40. class Accessory_LinkAdmin(admin.ModelAdmin):
  41. list_display = ('Accessory_Nom', 'Accessory_N_slugify', 'Accessory_icone', 'Accessory_on_list')
  42. pass