nautobot 1.6.26__py3-none-any.whl → 1.6.28__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1,3 +1,4 @@
1
+ import contextlib
1
2
  import django_tables2 as tables
2
3
  from django.contrib.auth.models import AnonymousUser
3
4
  from django.contrib.contenttypes.fields import GenericForeignKey
@@ -88,26 +89,31 @@ class BaseTable(tables.Table):
88
89
  self.columns.hide(column.name)
89
90
 
90
91
  # Apply custom column ordering for user
92
+ columns = []
93
+ pk = self.base_columns.pop("pk", None)
94
+ actions = self.base_columns.pop("actions", None)
95
+
91
96
  if user is not None and not isinstance(user, AnonymousUser):
92
97
  columns = user.get_config(f"tables.{self.__class__.__name__}.columns")
93
- if columns:
94
- pk = self.base_columns.pop("pk", None)
95
- actions = self.base_columns.pop("actions", None)
96
-
97
- for name, column in self.base_columns.items():
98
- if name in columns:
99
- self.columns.show(name)
100
- else:
101
- self.columns.hide(name)
102
- self.sequence = [c for c in columns if c in self.base_columns]
103
-
104
- # Always include PK and actions column, if defined on the table
105
- if pk:
106
- self.base_columns["pk"] = pk
107
- self.sequence.insert(0, "pk")
108
- if actions:
109
- self.base_columns["actions"] = actions
110
- self.sequence.append("actions")
98
+ if columns:
99
+ for name, column in self.base_columns.items():
100
+ if name in columns:
101
+ self.columns.show(name)
102
+ else:
103
+ self.columns.hide(name)
104
+ self.sequence = [c for c in columns if c in self.base_columns]
105
+
106
+ # Always include PK and actions column, if defined on the table
107
+ if pk:
108
+ with contextlib.suppress(ValueError):
109
+ self.sequence.remove("pk")
110
+ self.base_columns["pk"] = pk
111
+ self.sequence.insert(0, "pk")
112
+ if actions:
113
+ with contextlib.suppress(ValueError):
114
+ self.sequence.remove("actions")
115
+ self.base_columns["actions"] = actions
116
+ self.sequence.append("actions")
111
117
 
112
118
  # Dynamically update the table's QuerySet to ensure related fields are pre-fetched
113
119
  if isinstance(self.data, TableQuerysetData):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nautobot
3
- Version: 1.6.26
3
+ Version: 1.6.28
4
4
  Summary: Source of truth and network automation platform.
5
5
  Home-page: https://nautobot.com
6
6
  License: Apache-2.0
@@ -113,7 +113,7 @@ nautobot/core/management/commands/celery.py,sha256=wcdq4_Imwk889M-KriUVTWy2SCOX5
113
113
  nautobot/core/management/commands/generate_secret_key.py,sha256=hM-l1OmGiBgIauS9-wXYJBzkkpnhezMFgUuxZ5lNwDs,346
114
114
  nautobot/core/management/commands/generate_test_data.py,sha256=BP_uVG7RmdYfWeMQZ76kZ-FaRUVH35ACGIqlT_-EQfk,8319
115
115
  nautobot/core/management/commands/post_upgrade.py,sha256=-cZy3MXrq4yHGJ2Hh2w4xjcVMm2zf5F490WCNh1GQJA,5518
116
- nautobot/core/management/commands/pre_migrate.py,sha256=AjrNepSbkJs9_MLW0nSP2wfmYaQdxOnX1dTA1ESrSik,16578
116
+ nautobot/core/management/commands/pre_migrate.py,sha256=myDuwgJL4c9zN2yuMw5oZMZbr-kS4RCQpeGVcQJdVvo,17895
117
117
  nautobot/core/management/commands/refresh_content_type_cache.py,sha256=tXryp0RVoQua4jdbcqoX6jCWoKG05c6HlHAIvn4u0A4,1266
118
118
  nautobot/core/management/commands/send_installation_metrics.py,sha256=qmr9tWADEcLgSbEGt8P6LRDGeLYutrfml7p4S6W7Wik,3495
119
119
  nautobot/core/management/commands/start.py,sha256=LherN1UxKQtDCUAsRNHaz1yqfruWb9D4WIplMj69uno,154
@@ -241,7 +241,7 @@ nautobot/core/tests/test_authentication.py,sha256=SDODgDONxxGTa9_XsN0L9BR4PI_96q
241
241
  nautobot/core/tests/test_celery.py,sha256=dCSzVui-nbhHvTSoig8l3mVsEZIGxfWRv-U6lqSQfmk,203
242
242
  nautobot/core/tests/test_checks.py,sha256=cZNx-IGpfkwVrYRd3tSL8O6PQWzvDGKhEfr2YPXXw9o,1965
243
243
  nautobot/core/tests/test_cli.py,sha256=MDPKPXd-JrRQtWUe7Vsu3r8nmVgoZDbQ3M-MZlgxzcg,1027
244
- nautobot/core/tests/test_commands.py,sha256=sBXZigdCcf-RWNxP-rPEN96H7punlVv9msRcVZ_OAGQ,3232
244
+ nautobot/core/tests/test_commands.py,sha256=3WeGgnQSYXd96OsdCDBn_HqNqUMTCmclEWEgbCvYqfc,5206
245
245
  nautobot/core/tests/test_forms.py,sha256=gO5hPuQ6De2Vp6uGGknk7CutNbnwW1XZ59UqmwTLkSw,447
246
246
  nautobot/core/tests/test_graphql.py,sha256=BpPmkQfnzaDbjQV5hJ8U71P-eSZmu9gE-d-zrXzpE1g,91923
247
247
  nautobot/core/tests/test_models.py,sha256=KqFIHnByTyYOs9JtssjvBX7AmvCkSb4stlBz_WOzFB8,2319
@@ -568,7 +568,7 @@ nautobot/extras/secrets/__init__.py,sha256=QFU4ROlp1nW3muPSKv39G5hcSmB2NhF3wPlj_
568
568
  nautobot/extras/secrets/exceptions.py,sha256=cQXyJrW96wQyg78E3tJ13kFYZkG8OiVjWDwDUcDDixA,1564
569
569
  nautobot/extras/secrets/providers.py,sha256=I6llOxIjHcDb13kqFIzkCUWXQDAu39j0WmsD1OFPayA,2942
570
570
  nautobot/extras/signals.py,sha256=-1hnV4QT5yGnaeBv_txDLnHm2w-kE9Cqbj7tI9fH03Q,15339
571
- nautobot/extras/tables.py,sha256=TR7Sl5NdOhOjrX-0FumCImBhCFsrJrGwvGATJvDSc1o,30076
571
+ nautobot/extras/tables.py,sha256=m3z0OC7-dEeaG0Zsm7rUgpcMuWP63YBl5A5J5_SxZPM,30162
572
572
  nautobot/extras/tasks.py,sha256=SR99FIg8E4c4f1qocjbYbbGDrMxRe_ZsjHgoGE8mJ7o,6699
573
573
  nautobot/extras/templates/django_ajax_tables/ajax_wrapper.html,sha256=ej98qO2zpS-J6SAkdfbLmG7XAFleIF1kt0GqKY7GipE,2097
574
574
  nautobot/extras/templates/extras/computedfield.html,sha256=2b2UN8oUf7ow_EWASqU6g4Hht3pNAsAEu20rZVoPhHE,1958
@@ -885,7 +885,7 @@ nautobot/project-static/docs/code-reference/nautobot/apps/filters.html,sha256=at
885
885
  nautobot/project-static/docs/code-reference/nautobot/apps/forms.html,sha256=27pblS1OEpu2K5O25a_rMrRbDfUhzD7qUNuGbfjKWBY,369476
886
886
  nautobot/project-static/docs/code-reference/nautobot/apps/models.html,sha256=HZHdE3TxDyTJywC4S8FNJ65btiUk0AUSS8qRxGpPnGI,224503
887
887
  nautobot/project-static/docs/code-reference/nautobot/apps/secrets.html,sha256=Kzu-cRc-QLJRscjmVmEQKbk1ETyTh3YkHJpuuqHAmpk,103285
888
- nautobot/project-static/docs/code-reference/nautobot/apps/tables.html,sha256=XAMaExEjOrKkT6341V3Bx6120j6r-TW-6qWoojsO2VE,185338
888
+ nautobot/project-static/docs/code-reference/nautobot/apps/tables.html,sha256=IyRrORic2qbeoqhvgNfgYqjUp8K0tL2b32YILL0gg88,186853
889
889
  nautobot/project-static/docs/code-reference/nautobot/apps/testing.html,sha256=KjY2nKY2f2_TiBGfFQRFMBwjx1colcYdZA0t36h-b34,1832855
890
890
  nautobot/project-static/docs/code-reference/nautobot/apps/ui.html,sha256=LCvCOq4HNlHxfGs5eniXqjkO-zS8sXrh1M04i-YkyBs,309270
891
891
  nautobot/project-static/docs/code-reference/nautobot/apps/urls.html,sha256=xEi2zwsi6fSMQdSQfP2XBVbludViwbAk9Nfk3Q4_oyg,108546
@@ -893,7 +893,7 @@ nautobot/project-static/docs/code-reference/nautobot/apps/utils.html,sha256=JMfd
893
893
  nautobot/project-static/docs/code-reference/nautobot/apps/views.html,sha256=Nps9zjGwnIyxciDP74fBhmgkl2ewnNvf4-hnWBgSx1Y,402564
894
894
  nautobot/project-static/docs/configuration/authentication/ldap.html,sha256=blc128s_N1f_Qpofy8gkQpDxjiL4NeoM2o1RQ_Jt6RQ,124669
895
895
  nautobot/project-static/docs/configuration/authentication/remote.html,sha256=lZgL8php8J0u4meuzLsWIpKPgFO9OJdFTYT4IFNDrrs,90068
896
- nautobot/project-static/docs/configuration/authentication/sso.html,sha256=1IPrmIm9j6uuYPnSsairXhZLo2pKqgpm4OIuCFbJEnY,151378
896
+ nautobot/project-static/docs/configuration/authentication/sso.html,sha256=q6fErCEUFfGkExM3VBVliwQ37EpsB1IFjhAYDG65ym0,151392
897
897
  nautobot/project-static/docs/configuration/index.html,sha256=LLuQfknvncTE0ZLaK_n6A0iMIGRvjAE5hgFhek-8nlw,106547
898
898
  nautobot/project-static/docs/configuration/optional-settings.html,sha256=9vP5m_1A8DEo2ScPqeCsSylyb2OzYOqJYbX8i6nOhsA,221823
899
899
  nautobot/project-static/docs/configuration/required-settings.html,sha256=52clJ0i0wlYe8TqK8BQs_rax_IxrcCqeTxbB_2yMszc,135007
@@ -1076,14 +1076,14 @@ nautobot/project-static/docs/release-notes/version-1.2.html,sha256=QdkHnyK54mMjo
1076
1076
  nautobot/project-static/docs/release-notes/version-1.3.html,sha256=dae-rrbRyaF5s8oHGCMHPiJVpLUb6alEyqR-YDlnGVI,168543
1077
1077
  nautobot/project-static/docs/release-notes/version-1.4.html,sha256=CkEpfQMtKRqvIZA0CRn1PcD7_JhaNQ-58emphMEk8As,181807
1078
1078
  nautobot/project-static/docs/release-notes/version-1.5.html,sha256=v5zAmW27pEQqBuTs3DkNF7HDLvIqSYYNr5KqBN5zMbw,208157
1079
- nautobot/project-static/docs/release-notes/version-1.6.html,sha256=JuWkFcRuU4IrHnxowCqt6--8MKfcmgN6uF-rrVEVyDM,189213
1079
+ nautobot/project-static/docs/release-notes/version-1.6.html,sha256=pfaJxAoE_rf2pnVnorBBQ_RpLTXcXsQa-VAHLjujaHk,193441
1080
1080
  nautobot/project-static/docs/requirements.txt,sha256=v0uo_0GoM3QsvTrLeZVTC6GvKi3Ml7ExH_JMwI8Oxmo,227
1081
1081
  nautobot/project-static/docs/rest-api/authentication.html,sha256=N6R8AxPgk87fUA0mARPbLEOvj1J5YpVBd7bxlf533dY,95769
1082
1082
  nautobot/project-static/docs/rest-api/filtering.html,sha256=3oeK9XKYWvYDGsJO_quoRGENfxpT01VQouWsIijZQzU,102257
1083
1083
  nautobot/project-static/docs/rest-api/overview.html,sha256=_wimramudRVJ5uRoXoCf8mRF7LS9zI6WNQ_Soh4FSqk,210969
1084
- nautobot/project-static/docs/search/search_index.json,sha256=jv9utLV-1nr9GDih89iJTCMdLIKH3LE7XxiPadC-jAA,1988628
1085
- nautobot/project-static/docs/sitemap.xml,sha256=-iHqQdLbiK8ujHpS-WxUwkMjGb3POem2lK8pfZv7otw,37991
1086
- nautobot/project-static/docs/sitemap.xml.gz,sha256=bbc_rhtUSjblalXUlg0LQvEKb6oBARiEck-iqnQSu9Y,1659
1084
+ nautobot/project-static/docs/search/search_index.json,sha256=6NrzzFc7xrUZe2TFobWdlLZyHKnOK8BRUjuYQx0VFE0,1990375
1085
+ nautobot/project-static/docs/sitemap.xml,sha256=C98XtgWO2hZTC9mDKeQB4k7nv3rk3Rfneept1UViSlU,37991
1086
+ nautobot/project-static/docs/sitemap.xml.gz,sha256=R0TdKmqOq2tAQWSBFf8xpG4j9-Y6BRXZCIvofeHh5XQ,1660
1087
1087
  nautobot/project-static/docs/user-guides/custom-fields.html,sha256=sKctOd7DpshtDtm_jhe_qkGluFwX3SXRgogk0GBEEqY,133004
1088
1088
  nautobot/project-static/docs/user-guides/getting-started/creating-devices.html,sha256=bw0xY7tzoGBoE6pj6BsKheIpECHXiKFoIQXWMQhb4LY,93564
1089
1089
  nautobot/project-static/docs/user-guides/getting-started/index.html,sha256=7Z70Shfe_mePKPCEk-RK2Sfq-2SZ7z0Qsqbd-rMx3wE,86948
@@ -1404,7 +1404,7 @@ nautobot/utilities/paginator.py,sha256=BNk0NPVOeeDkdFhNMAm3Je5Y2t4sbd-0LzmbLbvRp
1404
1404
  nautobot/utilities/permissions.py,sha256=gRJDVt2tXB3TSWvbX7lo1euSA1UFXL47AuoE7aluDDE,3384
1405
1405
  nautobot/utilities/query_functions.py,sha256=wfIOaMEe0vJTjbA6UKxiDF6JOc-ZAkJxapOT1YagAOY,2492
1406
1406
  nautobot/utilities/querysets.py,sha256=pg9bPcZ4abPDjYoUgZQw5ByKTekw6n4SQ--VAVeBOyw,3722
1407
- nautobot/utilities/tables.py,sha256=Jch9esrvq3faXXg5fRIdQSdm9CQWaqyJNFcwx_IDOC0,18856
1407
+ nautobot/utilities/tables.py,sha256=TvRhPYUQ-nHQGWq8xcRgfLNcvSBVPdK5_RTwTm3yvwg,18986
1408
1408
  nautobot/utilities/tasks.py,sha256=zFYw0bWsrMgejpwmjX34rtAY0sUFhyMmT5bkBnuOF4Y,2073
1409
1409
  nautobot/utilities/templates/buttons/add.html,sha256=EILE_Min5aa55uqdk_RG0RSwDD-lBOfgLvCI6NGy7_M,179
1410
1410
  nautobot/utilities/templates/buttons/clone.html,sha256=MKnjqC-D9ZQhSBjV4cvZNIftJukNwvSdc16jfSBSflY,175
@@ -1509,9 +1509,9 @@ nautobot/virtualization/tests/test_models.py,sha256=O8mu0GB9gztj098FKTbRAaEi1Nwy
1509
1509
  nautobot/virtualization/tests/test_views.py,sha256=tAHLjoVmF0N20dM-7o1NPqW1UgyeIBRbw1CKZEneYKo,14456
1510
1510
  nautobot/virtualization/urls.py,sha256=F9lwHTuqORxJepRStGF7ZasDhQ7aD8cRQ-Mp_feY3YA,8162
1511
1511
  nautobot/virtualization/views.py,sha256=uACV3h2vOWm4ui14zX2cFNX6qs0_Jd5EfMvtLYV4EW0,15649
1512
- nautobot-1.6.26.dist-info/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
1513
- nautobot-1.6.26.dist-info/METADATA,sha256=w1iaKL4iWUrOR44ZK0NzZS9VABPVQw9bu4FyZO3H7JA,9624
1514
- nautobot-1.6.26.dist-info/NOTICE,sha256=2uSWs7KDIfOWAPxOGR_FdTW_41Zd4FTKGWXCqKZv2x4,267
1515
- nautobot-1.6.26.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1516
- nautobot-1.6.26.dist-info/entry_points.txt,sha256=kUwm_Ve_FyUFjcYqTtQWsqJ2JKWPkHFOD8rcK71jX2k,58
1517
- nautobot-1.6.26.dist-info/RECORD,,
1512
+ nautobot-1.6.28.dist-info/LICENSE.txt,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
1513
+ nautobot-1.6.28.dist-info/METADATA,sha256=zPuie2-yU80dL_XQRin0dmI4F2G2g4BTNJuLVuqv1fE,9624
1514
+ nautobot-1.6.28.dist-info/NOTICE,sha256=2uSWs7KDIfOWAPxOGR_FdTW_41Zd4FTKGWXCqKZv2x4,267
1515
+ nautobot-1.6.28.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
1516
+ nautobot-1.6.28.dist-info/entry_points.txt,sha256=kUwm_Ve_FyUFjcYqTtQWsqJ2JKWPkHFOD8rcK71jX2k,58
1517
+ nautobot-1.6.28.dist-info/RECORD,,