admin.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. from django.contrib import admin
  2. from metaservicesynced.models import Permissions, ServiceType, Provider, Documents, Client, Orders, Relationship
  3. @admin.register(Permissions)
  4. class PermissionsAdmin(admin.ModelAdmin):
  5. list_display = (
  6. 'id',
  7. 'check_date',
  8. 'id_permissions',
  9. 'check_level',
  10. 'checked_by',
  11. 'user_id',
  12. 'status',
  13. 'ticket_status',
  14. 'id_metaservice',
  15. 'is_global',
  16. 'is_visible',
  17. )
  18. list_filter = ('check_date', 'checked_by', 'user_id', 'ticket_status')
  19. @admin.register(ServiceType)
  20. class ServiceTypeAdmin(admin.ModelAdmin):
  21. list_display = (
  22. 'id',
  23. 'codename',
  24. 'caption',
  25. 'description',
  26. 'requirements',
  27. 'price_type',
  28. 'status',
  29. 'ticket_status',
  30. 'id_metaservice',
  31. 'link_agreement',
  32. 'is_global',
  33. 'is_visible',
  34. )
  35. list_filter = ('ticket_status',)
  36. @admin.register(Provider)
  37. class ProviderAdmin(admin.ModelAdmin):
  38. list_display = (
  39. 'id',
  40. 'type',
  41. 'user_id',
  42. 'id_metaservice',
  43. 'requirements',
  44. 'status',
  45. 'ticket_status',
  46. 'location_type',
  47. 'default_location',
  48. 'is_global',
  49. 'is_visible',
  50. )
  51. list_filter = ('user_id', 'ticket_status')
  52. @admin.register(Documents)
  53. class DocumentsAdmin(admin.ModelAdmin):
  54. list_display = (
  55. 'id',
  56. 'check_date',
  57. 'check_level',
  58. 'expire_date',
  59. 'id_metaservice',
  60. 'requirements',
  61. 'status',
  62. 'ticket_status',
  63. 'datalink',
  64. 'doc_type',
  65. 'user_id',
  66. 'is_global',
  67. 'is_visible',
  68. 'checked_by',
  69. )
  70. list_filter = (
  71. 'check_date',
  72. 'expire_date',
  73. 'ticket_status',
  74. 'user_id',
  75. 'checked_by',
  76. )
  77. @admin.register(Client)
  78. class ClientAdmin(admin.ModelAdmin):
  79. list_display = (
  80. 'id',
  81. 'user',
  82. 'requirements',
  83. 'status',
  84. 'ticket_status',
  85. 'id_metaservice',
  86. 'is_global',
  87. 'is_visible',
  88. )
  89. list_filter = ('user', 'ticket_status')
  90. @admin.register(Orders)
  91. class OrdersAdmin(admin.ModelAdmin):
  92. list_display = (
  93. 'id',
  94. 'service_type',
  95. 'state',
  96. 'id_metaservice',
  97. 'provider',
  98. 'receiver',
  99. 'client_id',
  100. 'time_created',
  101. 'time_placed',
  102. 'time_start',
  103. 'time_finish_predicted',
  104. 'time_finish_real',
  105. 'ticket',
  106. 'predicted_price',
  107. 'real_price',
  108. 'is_global',
  109. 'is_visible',
  110. )
  111. list_filter = (
  112. 'service_type',
  113. 'provider',
  114. 'receiver',
  115. 'client_id',
  116. 'time_created',
  117. 'time_placed',
  118. 'time_start',
  119. 'time_finish_predicted',
  120. 'time_finish_real',
  121. )
  122. @admin.register(Relationship)
  123. class RelationshipAdmin(admin.ModelAdmin):
  124. list_display = (
  125. 'id',
  126. 'user_id_who',
  127. 'user_id_whom',
  128. 'neg_type',
  129. 'id_metaservice',
  130. 'requirements',
  131. 'status',
  132. 'ticket_status',
  133. 'is_global',
  134. 'is_visible',
  135. )
  136. list_filter = ('user_id_who', 'user_id_whom', 'ticket_status')