admin.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. from django.contrib import admin
  2. from .models import *
  3. @admin.register(Company)
  4. class CompanyAdmin(admin.ModelAdmin):
  5. list_display = (
  6. 'id',
  7. 'legal_name',
  8. 'repr_id',
  9. 'inn',
  10. 'kpp',
  11. 'ogrn',
  12. 'bank_name',
  13. 'bik',
  14. 'ks',
  15. 'rs',
  16. 'address',
  17. 'requirements',
  18. 'status',
  19. 'ticket_status',
  20. 'id_metaservice',
  21. 'is_global',
  22. 'is_visible',
  23. )
  24. list_filter = ('repr_id', 'ticket_status')
  25. @admin.register(Permissions)
  26. class PermissionsAdmin(admin.ModelAdmin):
  27. list_display = (
  28. 'id',
  29. 'check_date',
  30. 'id_permissions',
  31. 'check_level',
  32. 'checked_by',
  33. 'user_id',
  34. 'status',
  35. 'ticket_status',
  36. 'id_metaservice',
  37. 'is_global',
  38. 'is_visible',
  39. )
  40. list_filter = ('check_date', 'checked_by', 'user_id', 'ticket_status')
  41. @admin.register(ServiceType)
  42. class ServiceTypeAdmin(admin.ModelAdmin):
  43. list_display = (
  44. 'id',
  45. 'codename',
  46. 'caption',
  47. 'description',
  48. 'requirements',
  49. 'price_type',
  50. 'status',
  51. 'ticket_status',
  52. 'id_metaservice',
  53. 'link_agreement',
  54. 'is_global',
  55. 'is_visible',
  56. )
  57. list_filter = ('ticket_status',)
  58. @admin.register(Provider)
  59. class ProviderAdmin(admin.ModelAdmin):
  60. list_display = (
  61. 'id',
  62. 'type',
  63. 'company_id',
  64. 'user_id',
  65. 'id_metaservice',
  66. 'requirements',
  67. 'status',
  68. 'ticket_status',
  69. 'location_type',
  70. 'default_location',
  71. 'is_global',
  72. 'is_visible',
  73. )
  74. list_filter = ('company_id', 'user_id', 'ticket_status')
  75. @admin.register(Resource)
  76. class ResourceAdmin(admin.ModelAdmin):
  77. list_display = (
  78. 'id',
  79. 'type_id',
  80. 'user_id',
  81. 'requirements',
  82. 'status',
  83. 'ticket_status',
  84. 'id_metaservice',
  85. 'is_global',
  86. 'is_visible',
  87. )
  88. list_filter = ('user_id', 'ticket_status')
  89. @admin.register(Service)
  90. class ServiceAdmin(admin.ModelAdmin):
  91. list_display = (
  92. 'id',
  93. 'servicetype_id',
  94. 'id_provider',
  95. 'resource_id',
  96. 'requirements',
  97. 'id_metaservice',
  98. 'price_alg',
  99. 'price_km',
  100. 'price_min',
  101. 'price_amount',
  102. 'service_status',
  103. 'status',
  104. 'ticket_status',
  105. 'is_global',
  106. 'is_visible',
  107. )
  108. list_filter = (
  109. 'servicetype_id',
  110. 'id_provider',
  111. 'resource_id',
  112. 'ticket_status',
  113. )
  114. @admin.register(Documents)
  115. class DocumentsAdmin(admin.ModelAdmin):
  116. list_display = (
  117. 'id',
  118. 'check_date',
  119. 'check_level',
  120. 'expire_date',
  121. 'id_metaservice',
  122. 'requirements',
  123. 'status',
  124. 'ticket_status',
  125. 'datalink',
  126. 'doc_type',
  127. 'user_id',
  128. 'company_id',
  129. 'is_global',
  130. 'is_visible',
  131. 'checked_by',
  132. )
  133. list_filter = (
  134. 'check_date',
  135. 'expire_date',
  136. 'ticket_status',
  137. 'user_id',
  138. 'company_id',
  139. 'checked_by',
  140. )
  141. @admin.register(Client)
  142. class ClientAdmin(admin.ModelAdmin):
  143. list_display = (
  144. 'id',
  145. 'user',
  146. 'requirements',
  147. 'status',
  148. 'ticket_status',
  149. 'id_metaservice',
  150. 'is_global',
  151. 'is_visible',
  152. )
  153. list_filter = ('user', 'ticket_status')
  154. @admin.register(Orders)
  155. class OrdersAdmin(admin.ModelAdmin):
  156. list_display = (
  157. 'id',
  158. 'service',
  159. 'service_type',
  160. 'state',
  161. 'id_metaservice',
  162. 'provider',
  163. 'receiver',
  164. 'client_id',
  165. 'time_created',
  166. 'time_placed',
  167. 'time_start',
  168. 'time_finish_predicted',
  169. 'time_finish_real',
  170. 'ticket',
  171. 'predicted_price',
  172. 'real_price',
  173. 'is_global',
  174. 'is_visible',
  175. )
  176. list_filter = (
  177. 'service',
  178. 'service_type',
  179. 'provider',
  180. 'receiver',
  181. 'client_id',
  182. 'time_created',
  183. 'time_placed',
  184. 'time_start',
  185. 'time_finish_predicted',
  186. 'time_finish_real',
  187. )
  188. @admin.register(Relationship)
  189. class RelationshipAdmin(admin.ModelAdmin):
  190. list_display = (
  191. 'id',
  192. 'user_id_who',
  193. 'user_id_whom',
  194. 'neg_type',
  195. 'id_metaservice',
  196. 'requirements',
  197. 'status',
  198. 'ticket_status',
  199. 'is_global',
  200. 'is_visible',
  201. )
  202. list_filter = ('user_id_who', 'user_id_whom', 'ticket_status')