tables.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802
  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.Column(attrs={"td": {"width": "50px"}})
  432. caption = tables.LinkColumn(
  433. 'sharix_admin:service_category/edit/',
  434. verbose_name='Услуга',
  435. orderable=False,
  436. text=lambda record: record.caption,
  437. args=[tables.A('pk')],
  438. attrs={
  439. "a": {"style": "pointer-events: none;"},
  440. 'th': {'scope': 'col'},
  441. "td": {"class": "name_col"}
  442. }
  443. )
  444. #codename = tables.LinkColumn(
  445. # 'sharix_admin:service_category/edit/',
  446. # verbose_name='Тех.название',
  447. # orderable=False,
  448. # text=lambda record: record.codename,
  449. # args=[tables.A('pk')],
  450. # attrs={
  451. # "a": {"style": "pointer-events: none;"},
  452. # 'th': {'scope': 'col'},
  453. # "td": {"class": "name_col"}
  454. # }
  455. #)
  456. description = tables.LinkColumn(
  457. 'sharix_admin:service_category/edit/',
  458. orderable=False, verbose_name='Описание',
  459. text=lambda record: record.description,
  460. args=[tables.A('pk')],
  461. attrs={
  462. "a": {"style": "pointer-events: none;"},
  463. 'th': {'scope': 'col'},
  464. "td": {"class": "description_col"}
  465. }
  466. )
  467. metaservice_comission = tables.Column(
  468. verbose_name=_('Комиссия Сервиса'),
  469. attrs={
  470. 'th': {'scope': 'col'},
  471. "td": {"width": "15%"}}
  472. )
  473. edit = tables.LinkColumn(
  474. 'sharix_admin:service_category/edit/',
  475. verbose_name='',
  476. orderable=False,
  477. text="E",
  478. args=[tables.A('pk')],
  479. attrs={
  480. 'th': {'scope': 'col'},
  481. "td": {"class": "edit_col"}
  482. }
  483. )
  484. check = tables.BooleanColumn(
  485. verbose_name=_('Activity'),
  486. orderable=False,
  487. attrs={
  488. 'th': {'scope': 'col'},
  489. "td": {"width": "5%"}
  490. }
  491. )
  492. #TODO change to 'change status!'
  493. #deletee = tables.LinkColumn(
  494. # 'sharix_admin:service_category/delete/',
  495. # verbose_name='',
  496. # orderable=False,
  497. # text="D",
  498. # args=[tables.A('pk')],
  499. # attrs={
  500. # 'th': {'scope': 'col'},
  501. # "td": {"class": "delete_col"}
  502. # }
  503. #)
  504. class Meta:
  505. model = ServiceCategory
  506. attrs = {
  507. "class": "table table-layout-fixed text-start"
  508. }
  509. exclude = (
  510. 'requirements',
  511. 'price_type',
  512. 'status',
  513. 'ticket_status',
  514. 'id_metaservice',
  515. 'link_agreement',
  516. 'is_global',
  517. 'is_visible',
  518. 'codename',
  519. )
  520. def render_check(self, value, record):
  521. if record.status == '0':
  522. #if record.status == 'active':
  523. return format_html(
  524. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service_category-id="{}">',
  525. record.id
  526. )
  527. #return format_html('<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service_category-id="{}">')
  528. #return format_html('<input class="form-check-input status-toggle" disabled checked type="checkbox"')
  529. else:
  530. return format_html(
  531. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-service_category-id="{}">',
  532. record.id
  533. )
  534. #return format_html('<input class="form-check-input status-toggle" disabled type="checkbox"')
  535. # def render_delete(self, value, record):
  536. # return format_html('<a href="/service_category/delete" class="btn btn-outline-danger">_(Delete)</a>')
  537. # def render_name_operation(self, value, record):
  538. # return format_html("<a href='{}'>{}</a>", record.get_absolute_url(), value)
  539. class ServiceTable(tables.Table):
  540. id = tables.Column(
  541. verbose_name=_('ID'),
  542. attrs={
  543. "td": {"width": "5%"}
  544. }
  545. )
  546. service_category = tables.Column(
  547. verbose_name=_('Description of the service'),
  548. accessor='service_category.caption',
  549. attrs={
  550. 'th': {'scope': 'col'},
  551. "td": {"width": "20%"}}
  552. )
  553. # description = tables.Column(verbose_name='Название тарифа', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  554. # description = tables.Column(verbose_name='Описание строки тарифов', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  555. # price_type = tables.Column(verbose_name='Тип тарифа', attrs={'th':{'scope':'col'}, "td":{"width":"20%"}})
  556. price_km = tables.Column(
  557. verbose_name=_('Cost km.'),
  558. attrs={
  559. 'th': {'scope': 'col'},
  560. "td": {"width": "20%"}
  561. }
  562. )
  563. price_min = tables.Column(
  564. verbose_name=_('Cost min.'),
  565. attrs={
  566. 'th': {'scope': 'col'},
  567. "td": {"width": "20%"}}
  568. )
  569. price_amount = tables.Column(
  570. verbose_name=_('Cost of service'),
  571. attrs={
  572. 'th': {'scope': 'col'},
  573. "td": {"width": "20%"}
  574. }
  575. )
  576. class Meta:
  577. model = Service
  578. attrs = {
  579. "class": "table table-layout-fixed"
  580. }
  581. exclude = (
  582. 'resource',
  583. 'requirements',
  584. 'id_metaservice',
  585. 'price_type',
  586. 'ticket_status',
  587. 'is_global',
  588. 'is_visible'
  589. )
  590. def render_check(self, value, record):
  591. if record.status == 'active':
  592. return format_html(
  593. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-service-id="{}">',
  594. record.id
  595. )
  596. else:
  597. return format_html(
  598. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-service-id="{}">',
  599. record.id
  600. )
  601. class UserInfoTable(tables.Table):
  602. id = tables.Column(
  603. verbose_name=_('ID'),
  604. attrs={
  605. "td": {"width": "5%"}
  606. }
  607. )
  608. class Meta:
  609. model = get_user_model()
  610. attrs = {
  611. "class": "table table-layout-fixed"
  612. }
  613. exclude = (
  614. 'password',
  615. 'phone_number',
  616. 'last_login',
  617. 'is_staff',
  618. 'is_superuser',
  619. 'date_joined'
  620. )
  621. class PermissionsTable(tables.Table):
  622. id = tables.Column(
  623. verbose_name=_('ID'),
  624. attrs={
  625. "td": {"width": "5%"}
  626. }
  627. )
  628. user = tables.Column(
  629. accessor='user.full_name',
  630. order_by=('user.first_name', 'user.last_name'),
  631. verbose_name=_('User'),
  632. attrs={
  633. "td": {"width": "15%"}
  634. }
  635. )
  636. id_permissions = tables.Column(
  637. verbose_name=_('Permission'),
  638. attrs={
  639. "td": {"width": "15%"}
  640. }
  641. )
  642. status = tables.Column(
  643. verbose_name=_('Status'),
  644. attrs={
  645. 'th': {'scope': 'col'},
  646. "td": {"width": "20%"}
  647. }
  648. )
  649. check = tables.BooleanColumn(
  650. verbose_name='',
  651. attrs={
  652. 'th': {'scope': 'col'},
  653. "td": {"width": "20%"}
  654. }
  655. )
  656. # paginate_by = 10
  657. class Meta:
  658. model = Permissions
  659. attrs = {
  660. "class": "table table-layout-fixed"
  661. }
  662. exclude = (
  663. 'check_date',
  664. 'expire_date',
  665. 'check_level',
  666. 'checked_by',
  667. 'ticket_status'
  668. )
  669. def render_check(self, value, record):
  670. if record.status == 'active':
  671. return format_html(
  672. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  673. record.id
  674. )
  675. else:
  676. return format_html(
  677. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-resource-id="{}">',
  678. record.id
  679. )
  680. class RelationshipTable(tables.Table):
  681. id = tables.Column(
  682. verbose_name=_('ID'),
  683. attrs={
  684. "td": {"width": "5%"}
  685. }
  686. )
  687. user_who = tables.Column(
  688. accessor='user_who.full_name',
  689. order_by=('user_who.first_name', 'user_who.last_name'),
  690. verbose_name=_('Initiator'),
  691. attrs={
  692. "td": {"width": "15%"}
  693. }
  694. )
  695. user_whom = tables.Column(
  696. accessor='user_whom.full_name',
  697. order_by=('user_whom.first_name', 'user_whom.last_name'),
  698. verbose_name=_('Goal'),
  699. attrs={
  700. "td": {"width": "15%"}
  701. }
  702. )
  703. neg_type = tables.Column(
  704. verbose_name=_('Neg Type'),
  705. attrs={
  706. 'th': {'scope': 'col'},
  707. "td": {"width": "20%"}
  708. }
  709. )
  710. status = tables.Column(
  711. verbose_name=_('Status'),
  712. attrs={
  713. 'th': {'scope': 'col'},
  714. "td": {"width": "20%"}
  715. }
  716. )
  717. check = tables.BooleanColumn(
  718. verbose_name='',
  719. attrs={
  720. 'th': {'scope': 'col'},
  721. "td": {"width": "20%"}
  722. }
  723. )
  724. paginate_by = 10
  725. class Meta:
  726. model = Relationship
  727. attrs = {
  728. "class": "table table-layout-fixed"
  729. }
  730. exclude = (
  731. 'ticket_status',
  732. )
  733. def render_check(self, value, record):
  734. if record.status == 'active':
  735. return format_html(
  736. '<input class="form-check-input status-toggle" checked type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  737. record.id
  738. )
  739. else:
  740. return format_html(
  741. '<input class="form-check-input status-toggle" type="checkbox" id="flexCheckDefault" data-provider-id="{}">',
  742. record.id
  743. )