tables.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. import django_tables2 as tables
  2. from dbsynce.models import *
  3. from dbsynce.models import *
  4. from django.contrib.auth import get_user_model
  5. from django.utils.html import format_html
  6. from django.utils.translation import gettext_lazy as _
  7. from dbsynce.lib.dicts import *
  8. class TransactionsWalletTable(tables.Table):
  9. # id = tables.Column(order_by=True)
  10. id = tables.Column(
  11. verbose_name='#',
  12. orderable=False,
  13. attrs={
  14. "td": {"width": "5%"}
  15. }
  16. )
  17. wallet = tables.Column(
  18. verbose_name=_('Owner'),
  19. orderable=False,
  20. attrs={
  21. "td": {"width": "15%"}
  22. }
  23. )
  24. name_operation = tables.Column(
  25. verbose_name=_('Service'),
  26. attrs={
  27. 'th': {'scope': 'col'},
  28. "td": {"width": "20%"}
  29. }
  30. )
  31. price = tables.Column(
  32. verbose_name=_('Points'),
  33. attrs={
  34. "class": "row",
  35. "td": {"width": "10%"}
  36. }
  37. )
  38. date_operation = tables.Column(
  39. verbose_name=_('Registration date'),
  40. attrs={
  41. "td": {"width": "30%"}
  42. }
  43. )
  44. is_carried_out = tables.BooleanColumn(
  45. verbose_name=_('Status'),
  46. orderable=False,
  47. yesno=_("Successful, not successful"),
  48. attrs={
  49. "td": {"width": "20%"}
  50. }
  51. )
  52. class Meta:
  53. # model = TransactionsWallets
  54. attrs = {
  55. "class": "table table-striped"
  56. }
  57. exclude = (
  58. "balance_before",
  59. "amount",
  60. "metaservice_id",
  61. "transaction_type",
  62. "doc_num",
  63. "service_id"
  64. )
  65. def render_name_operation(self, value, record):
  66. return format_html(
  67. "<a href='{}'>{}</a>",
  68. record.get_absolute_url(),
  69. value
  70. )
  71. class PartnersTable(tables.Table):
  72. id = tables.Column(
  73. verbose_name=_('ID'),
  74. attrs={
  75. "td": {"width": "5%"}
  76. }
  77. )
  78. #legal_name = tables.Column(
  79. # verbose_name=_('Legal entity'),
  80. # attrs={
  81. # 'th': {'scope': 'col'},
  82. # "td": {"width": "20%"}
  83. # }
  84. #)
  85. legal_name = tables.LinkColumn(
  86. 'sharix_admin:partner_detail',
  87. args=[tables.A('pk')],
  88. verbose_name=_('Legal entity'),
  89. #args=[tables.A('pk')],
  90. attrs={
  91. 'th': {'scope': 'col'},
  92. "td": {"width": "20%"}
  93. }
  94. )
  95. repr = tables.Column(
  96. accessor='repr.full_name',
  97. order_by=('repr.first_name', 'repr.last_name'),
  98. verbose_name=_('Responsible'),
  99. attrs={
  100. "td": {"width": "15%"}
  101. }
  102. )
  103. status = tables.Column(
  104. verbose_name=_('Status'),
  105. attrs={
  106. 'th': {'scope': 'col'},
  107. "td": {"width": "20%"}
  108. }
  109. )
  110. check = tables.BooleanColumn(
  111. verbose_name='',
  112. attrs={
  113. 'th': {'scope': 'col'},
  114. "td": {"width": "20%"}
  115. }
  116. )
  117. # paginate_by = 10
  118. class Meta:
  119. model = Company
  120. attrs = {
  121. "class": "table table-layout-fixed"
  122. }
  123. exclude = (
  124. 'inn',
  125. 'kpp',
  126. 'ogrn',
  127. 'bank_name',
  128. 'bik',
  129. 'ks',
  130. 'rs',
  131. 'address',
  132. 'requirements',
  133. 'id_metaservice',
  134. 'is_global',
  135. 'is_visible',
  136. 'ticket_status',
  137. )
  138. def render_check(self, value, record):
  139. if record.status == 'active':
  140. return format_html(
  141. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-partners-id="{}">',
  142. record.id
  143. )
  144. else:
  145. return format_html(
  146. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-partners-id="{}">',
  147. record.id
  148. )
  149. class OrdersTable(tables.Table):
  150. id = tables.Column(
  151. verbose_name=_('ID'),
  152. attrs={
  153. "td": {"width": "5%"}
  154. }
  155. )
  156. title = tables.LinkColumn(
  157. 'sharix_admin:order_detail',
  158. args=[tables.A('pk')],
  159. verbose_name=_('Title'),
  160. attrs={
  161. "td": {"width": "20%"}
  162. }
  163. )
  164. status = tables.Column(
  165. accessor='status',
  166. #accessor='status_by_code(status)',
  167. verbose_name=_('Status'),
  168. attrs={
  169. "td": {"width": "15%"}
  170. }
  171. )
  172. receiver = tables.Column(
  173. accessor='receiver.get_full_name',
  174. verbose_name=_('Receiver'),
  175. #'sharix_admin:user_detail',
  176. #args=[tables.A('pk')],
  177. attrs={
  178. "td": {"width": "20%"}
  179. }
  180. )
  181. time_created = tables.DateTimeColumn(
  182. verbose_name=_('Created'),
  183. attrs={
  184. "td": {"width": "20%"}
  185. }
  186. )
  187. class Meta:
  188. model = Orders
  189. attrs = {
  190. "class": "table table-layout-fixed"
  191. }
  192. exclude = (
  193. 'id_metaservice',
  194. 'note',
  195. 'time_placed',
  196. 'time_start',
  197. 'time_start_real',
  198. 'time_start_predicted',
  199. 'time_finish_real',
  200. 'time_finish_predicted',
  201. 'real_price',
  202. 'predicted_price',
  203. 'asap',
  204. 'is_global',
  205. 'is_visible',
  206. 'ticket',
  207. 'service',
  208. 'service_category',
  209. 'client',
  210. 'provider',
  211. 'company')
  212. class ResourcesTable(tables.Table):
  213. id = tables.LinkColumn(
  214. 'sharix_admin:resource_detail',
  215. args=[tables.A('pk')],
  216. verbose_name=_('ID'),
  217. attrs={
  218. "td": {"width": "5%"}
  219. }
  220. )
  221. # В user ссылка LinkColumn на страницу Аси "Информация о партнере" страница partner_information_form
  222. user = tables.Column(
  223. accessor='user.get_full_name',
  224. order_by=('user.first_name', 'user.last_name'),
  225. verbose_name=_('Responsible'),
  226. attrs={
  227. "td": {"width": "15%"}
  228. }
  229. )
  230. status = tables.Column(
  231. verbose_name=_('Status'),
  232. attrs={
  233. 'th': {'scope': 'col'},
  234. "td": {"width": "20%"}
  235. }
  236. )
  237. resource_type = tables.Column(
  238. attrs={
  239. 'th': {'scope': 'col'},
  240. "td": {"width": "20%"}
  241. }
  242. )
  243. check = tables.BooleanColumn(
  244. verbose_name='',
  245. attrs={
  246. 'th': {'scope': 'col'},
  247. "td": {"width": "40%"}
  248. }
  249. )
  250. # paginate_by = 10
  251. class Meta:
  252. model = Resource
  253. attrs = {
  254. "class": "table table-layout-fixed"
  255. }
  256. exclude = (
  257. 'id_metaservice',
  258. 'requirements',
  259. 'is_global',
  260. 'is_visible',
  261. 'ticket_status'
  262. )
  263. def render_check(self, value, record):
  264. if record.status == 'active':
  265. return format_html(
  266. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  267. record.id
  268. )
  269. else:
  270. return format_html(
  271. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  272. record.id
  273. )
  274. class ProvidersTable(tables.Table):
  275. id = tables.LinkColumn(
  276. 'sharix_admin:provider_detail',
  277. args=[tables.A('pk')],
  278. verbose_name=_('ID'),
  279. attrs={
  280. "td": {"width": "5%"}
  281. }
  282. )
  283. user = tables.Column(
  284. accessor='user.full_name',
  285. order_by=('user.first_name', 'user.last_name'),
  286. verbose_name=_('Full Name'),
  287. attrs={
  288. "td": {"width": "15%"}
  289. }
  290. )
  291. status = tables.Column(
  292. #verbose_name=_('Status'),
  293. attrs={
  294. 'th': {'scope': 'col'},
  295. "td": {"width": "20%"}
  296. }
  297. )
  298. service = tables.LinkColumn(
  299. 'sharix_admin:service_tariff_detail',
  300. args=[tables.A('service.pk')],
  301. accessor='service.caption',
  302. verbose_name=_('Service'),
  303. attrs={
  304. 'th': {'scope': 'col'},
  305. "td": {"width": "20%"}
  306. }
  307. )
  308. resource = tables.LinkColumn(
  309. 'sharix_admin:resource_detail',
  310. args=[tables.A('resource.pk')],
  311. accessor='resource.resource_type',
  312. verbose_name=_('Resource'),
  313. attrs={
  314. 'th': {'scope': 'col'},
  315. "td": {"width": "20%"}
  316. }
  317. )
  318. check = tables.BooleanColumn(
  319. verbose_name='',
  320. attrs={
  321. 'th': {'scope': 'col'},
  322. "td": {"width": "20%"}
  323. }
  324. )
  325. paginate_by = 10
  326. class Meta:
  327. model = Provider
  328. attrs = {
  329. "class": "table table-layout-fixed"
  330. }
  331. exclude = (
  332. 'id_metaservice',
  333. 'gap',
  334. 'requirements',
  335. 'status',
  336. 'service_status',
  337. 'location_type',
  338. 'default_location',
  339. 'is_global',
  340. 'is_visible',
  341. 'ticket_status',
  342. )
  343. def render_check(self, value, record):
  344. if record.status == 'active':
  345. return format_html(
  346. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  347. record.id
  348. )
  349. else:
  350. return format_html(
  351. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  352. record.id
  353. )
  354. class ServiceTariffsTable(tables.Table):
  355. id = tables.Column(
  356. verbose_name=_('ID'),
  357. attrs={
  358. "td": {"width": "5%"}
  359. }
  360. )
  361. codename = tables.LinkColumn(
  362. 'sharix_admin:service_tariff/edit/',
  363. verbose_name=_('Кодовое название'),
  364. text=lambda record: record.caption,
  365. args=[tables.A('pk')],
  366. attrs={
  367. 'th': {'scope': 'col'},
  368. "td": {"width": "15%"}
  369. }
  370. )
  371. #service_category = tables.Column(
  372. service_category = tables.LinkColumn(
  373. 'sharix_admin:service_category/edit/',
  374. verbose_name=_('Название схемы услуги'),
  375. text=lambda record: record.service_category.caption,
  376. args=[tables.A('pk')],
  377. attrs={
  378. 'th': {'scope': 'col'},
  379. "td": {"width": "15%"}
  380. }
  381. )
  382. resource_type = tables.Column(
  383. verbose_name=_('Тип ресурса'),
  384. attrs={
  385. 'th': {'scope': 'col'},
  386. "td": {"width": "20%"}
  387. }
  388. )
  389. company_comission = tables.Column(
  390. verbose_name=_('Комиссия партнера'),
  391. attrs={
  392. 'th': {'scope': 'col'},
  393. "td": {"width": "20%"}
  394. }
  395. )
  396. check = tables.BooleanColumn(
  397. verbose_name=_('Activity'),
  398. orderable=False,
  399. attrs={
  400. 'th': {'scope': 'col'},
  401. "td": {"width": "20%"}
  402. }
  403. )
  404. class Meta:
  405. model = Service
  406. attrs = {
  407. "class": "table table-layout-fixed"
  408. }
  409. exclude = (
  410. 'resource',
  411. 'company',
  412. 'caption',
  413. 'description',
  414. 'price_type',
  415. 'price_min',
  416. 'price_amount',
  417. 'id_metaservice',
  418. 'requirements',
  419. 'ticket_status',
  420. 'price_km',
  421. 'is_global',
  422. 'is_visible',
  423. 'status'
  424. )
  425. def render_check(self, value, record):
  426. if record.status == 'active':
  427. return format_html('<input class="form-check-input status-toggle" disabled checked type="checkbox"')
  428. else:
  429. return format_html('<input class="form-check-input status-toggle" disabled type="checkbox"')
  430. class ServiceCategoriesTable(tables.Table):
  431. id = tables.LinkColumn(
  432. 'sharix_admin:service_category_detail',
  433. args=[tables.A('pk')],
  434. attrs={"td": {"width": "50px"}}
  435. )
  436. caption = tables.LinkColumn(
  437. 'sharix_admin:service_category_detail',
  438. verbose_name='Услуга',
  439. orderable=False,
  440. text=lambda record: record.caption,
  441. args=[tables.A('pk')],
  442. attrs={
  443. "a": {"style": "pointer-events: none;"},
  444. 'th': {'scope': 'col'},
  445. "td": {"class": "name_col"}
  446. }
  447. )
  448. #codename = tables.LinkColumn(
  449. # 'sharix_admin:service_category/edit/',
  450. # verbose_name='Тех.название',
  451. # orderable=False,
  452. # text=lambda record: record.codename,
  453. # args=[tables.A('pk')],
  454. # attrs={
  455. # "a": {"style": "pointer-events: none;"},
  456. # 'th': {'scope': 'col'},
  457. # "td": {"class": "name_col"}
  458. # }
  459. #)
  460. description = tables.Column(
  461. orderable=False,
  462. #verbose_name='Описание',
  463. #text=lambda record: record.description,
  464. #args=[tables.A('pk')],
  465. attrs={
  466. "a": {"style": "pointer-events: none;"},
  467. 'th': {'scope': 'col'},
  468. "td": {"class": "description_col"}
  469. }
  470. )
  471. metaservice_comission = tables.Column(
  472. #verbose_name=_('Комиссия Сервиса'),
  473. attrs={
  474. 'th': {'scope': 'col'},
  475. "td": {"width": "15%"}}
  476. )
  477. edit = tables.LinkColumn(
  478. 'sharix_admin:service_category/edit/',
  479. verbose_name='',
  480. orderable=False,
  481. text="E",
  482. args=[tables.A('pk')],
  483. attrs={
  484. 'th': {'scope': 'col'},
  485. "td": {"class": "edit_col"}
  486. }
  487. )
  488. check = tables.BooleanColumn(
  489. verbose_name=_('Activity'),
  490. orderable=False,
  491. attrs={
  492. 'th': {'scope': 'col'},
  493. "td": {"width": "5%"}
  494. }
  495. )
  496. #TODO change to 'change status!'
  497. #deletee = tables.LinkColumn(
  498. # 'sharix_admin:service_category/delete/',
  499. # verbose_name='',
  500. # orderable=False,
  501. # text="D",
  502. # args=[tables.A('pk')],
  503. # attrs={
  504. # 'th': {'scope': 'col'},
  505. # "td": {"class": "delete_col"}
  506. # }
  507. #)
  508. class Meta:
  509. model = ServiceCategory
  510. attrs = {
  511. "class": "table table-layout-fixed text-start"
  512. }
  513. exclude = (
  514. 'requirements',
  515. 'price_type',
  516. 'status',
  517. 'ticket_status',
  518. 'id_metaservice',
  519. 'link_agreement',
  520. 'is_global',
  521. 'is_visible',
  522. 'codename',
  523. )
  524. def render_check(self, value, record):
  525. if record.status == '0':
  526. #if record.status == 'active':
  527. return format_html(
  528. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service_category-id="{}">',
  529. record.id
  530. )
  531. #return format_html('<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service_category-id="{}">')
  532. #return format_html('<input class="form-check-input status-toggle" disabled checked type="checkbox"')
  533. else:
  534. return format_html(
  535. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-service_category-id="{}">',
  536. record.id
  537. )
  538. #return format_html('<input class="form-check-input status-toggle" disabled type="checkbox"')
  539. # def render_delete(self, value, record):
  540. # return format_html('<a href="/service_category/delete" class="btn btn-outline-danger">_(Delete)</a>')
  541. # def render_name_operation(self, value, record):
  542. # return format_html("<a href='{}'>{}</a>", record.get_absolute_url(), value)
  543. class ServiceTable(tables.Table):
  544. id = tables.Column(
  545. verbose_name=_('ID'),
  546. attrs={
  547. "td": {"width": "5%"}
  548. }
  549. )
  550. service_category = tables.Column(
  551. verbose_name=_('Description of the service'),
  552. accessor='service_category.caption',
  553. attrs={
  554. 'th': {'scope': 'col'},
  555. "td": {"width": "20%"}}
  556. )
  557. # description = tables.Column(verbose_name='Название тарифа', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  558. # description = tables.Column(verbose_name='Описание строки тарифов', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  559. # price_type = tables.Column(verbose_name='Тип тарифа', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  560. price_km = tables.Column(
  561. verbose_name=_('Cost km.'),
  562. attrs={
  563. 'th': {'scope': 'col'},
  564. "td": {"width": "20%"}
  565. }
  566. )
  567. price_min = tables.Column(
  568. verbose_name=_('Cost min.'),
  569. attrs={
  570. 'th': {'scope': 'col'},
  571. "td": {"width": "20%"}}
  572. )
  573. price_amount = tables.Column(
  574. verbose_name=_('Cost of service'),
  575. attrs={
  576. 'th': {'scope': 'col'},
  577. "td": {"width": "20%"}
  578. }
  579. )
  580. class Meta:
  581. model = Service
  582. attrs = {
  583. "class": "table table-layout-fixed"
  584. }
  585. exclude = (
  586. 'resource',
  587. 'requirements',
  588. 'id_metaservice',
  589. 'price_type',
  590. 'ticket_status',
  591. 'is_global',
  592. 'is_visible'
  593. )
  594. def render_check(self, value, record):
  595. if record.status == 'active':
  596. return format_html(
  597. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service-id="{}">',
  598. record.id
  599. )
  600. else:
  601. return format_html(
  602. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-service-id="{}">',
  603. record.id
  604. )
  605. class UserInfoTable(tables.Table):
  606. id = tables.Column(
  607. verbose_name=_('ID'),
  608. attrs={
  609. "td": {"width": "5%"}
  610. }
  611. )
  612. class Meta:
  613. model = get_user_model()
  614. attrs = {
  615. "class": "table table-layout-fixed"
  616. }
  617. exclude = (
  618. 'password',
  619. 'phone_number',
  620. 'last_login',
  621. 'is_staff',
  622. 'is_superuser',
  623. 'date_joined'
  624. )
  625. class PermissionsTable(tables.Table):
  626. id = tables.Column(
  627. verbose_name=_('ID'),
  628. attrs={
  629. "td": {"width": "5%"}
  630. }
  631. )
  632. user = tables.Column(
  633. accessor='user.full_name',
  634. order_by=('user.first_name', 'user.last_name'),
  635. verbose_name=_('User'),
  636. attrs={
  637. "td": {"width": "15%"}
  638. }
  639. )
  640. id_permissions = tables.Column(
  641. verbose_name=_('Permission'),
  642. attrs={
  643. "td": {"width": "15%"}
  644. }
  645. )
  646. status = tables.Column(
  647. verbose_name=_('Status'),
  648. attrs={
  649. 'th': {'scope': 'col'},
  650. "td": {"width": "20%"}
  651. }
  652. )
  653. check = tables.BooleanColumn(
  654. verbose_name='',
  655. attrs={
  656. 'th': {'scope': 'col'},
  657. "td": {"width": "20%"}
  658. }
  659. )
  660. # paginate_by = 10
  661. class Meta:
  662. model = Permissions
  663. attrs = {
  664. "class": "table table-layout-fixed"
  665. }
  666. exclude = (
  667. 'check_date',
  668. 'expire_date',
  669. 'check_level',
  670. 'checked_by',
  671. 'ticket_status'
  672. )
  673. def render_check(self, value, record):
  674. if record.status == 'active':
  675. return format_html(
  676. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  677. record.id
  678. )
  679. else:
  680. return format_html(
  681. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  682. record.id
  683. )
  684. class RelationshipTable(tables.Table):
  685. id = tables.Column(
  686. verbose_name=_('ID'),
  687. attrs={
  688. "td": {"width": "5%"}
  689. }
  690. )
  691. user_who = tables.Column(
  692. accessor='user_who.full_name',
  693. order_by=('user_who.first_name', 'user_who.last_name'),
  694. verbose_name=_('Initiator'),
  695. attrs={
  696. "td": {"width": "15%"}
  697. }
  698. )
  699. user_whom = tables.Column(
  700. accessor='user_whom.full_name',
  701. order_by=('user_whom.first_name', 'user_whom.last_name'),
  702. verbose_name=_('Goal'),
  703. attrs={
  704. "td": {"width": "15%"}
  705. }
  706. )
  707. neg_type = tables.Column(
  708. verbose_name=_('Neg Type'),
  709. attrs={
  710. 'th': {'scope': 'col'},
  711. "td": {"width": "20%"}
  712. }
  713. )
  714. status = tables.Column(
  715. verbose_name=_('Status'),
  716. attrs={
  717. 'th': {'scope': 'col'},
  718. "td": {"width": "20%"}
  719. }
  720. )
  721. check = tables.BooleanColumn(
  722. verbose_name='',
  723. attrs={
  724. 'th': {'scope': 'col'},
  725. "td": {"width": "20%"}
  726. }
  727. )
  728. paginate_by = 10
  729. class Meta:
  730. model = Relationship
  731. attrs = {
  732. "class": "table table-layout-fixed"
  733. }
  734. exclude = (
  735. 'ticket_status',
  736. )
  737. def render_check(self, value, record):
  738. if record.status == 'active':
  739. return format_html(
  740. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  741. record.id
  742. )
  743. else:
  744. return format_html(
  745. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  746. record.id
  747. )