1
0

admin.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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_with_Snow', '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(PIC_History)
  12. class PIC_HistoryAdmin(admin.ModelAdmin):
  13. list_display = ('H_PIC', 'H_Date', 'H_Commentaire')
  14. pass
  15. @admin.register(PIS)
  16. class PISAdmin(ImportExportModelAdmin):
  17. list_display = ('PIS_Site', 'PIS_Localisation','PIS_Nom_netbios','PIS_Friendly_Name', 'PIS_Type', 'PIS_Role', 'PIS_Adresse_IP', 'PIS_Commentaires')
  18. list_filter = ('PIS_Site', 'PIS_Type', 'PIS_Archive', 'PIS_Role')
  19. search_fields = ['PIS_Nom_netbios', 'PIS_Role', 'PIS_Adresse_IP','PIS_Localisation', 'PIS_Commentaires']
  20. pass
  21. @admin.register(Swich)
  22. class SwichAdmin(ImportExportModelAdmin):
  23. list_display = ('SW_Baie','SW_Nom', 'SW_IP', 'SW_OS', 'SW_TYPE')
  24. list_filter = ('SW_Baie__BAIE_Site_NG','SW_Baie', 'SW_OS', 'SW_TYPE')
  25. search_fields = ['SW_Baie', 'SW_Nom','SW_IP', 'SW_Commentaires']
  26. pass
  27. @admin.register(Port_Link)
  28. class Port_LinkAdmin(admin.ModelAdmin):
  29. list_display = ('PL_Swich', 'PL_Port_NG', 'PL_VLAN', 'PL_Headbang_plug', 'PL_Commentaires')
  30. pass
  31. @admin.register(Baie)
  32. class BaieAdmin(admin.ModelAdmin):
  33. list_display = ('BAIE_Site_NG', 'BAIE_Nom', 'BAIE_Local')
  34. pass
  35. @admin.register(Accessory_Link)
  36. class Accessory_LinkAdmin(admin.ModelAdmin):
  37. list_display = ('Accessory_Nom', 'Accessory_N_slugify', 'Accessory_icone', 'Accessory_on_list')
  38. pass