Skip to content

Commit 88f7b65

Browse files
authored
19380 call configure on embedded tables (#19390)
* 19380 call configure on embedded tables * 19380 call configure on embedded tables * 19380 call configure on embedded tables
1 parent 6e49cee commit 88f7b65

File tree

7 files changed

+27
-0
lines changed

7 files changed

+27
-0
lines changed

netbox/account/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def get(self, request):
197197
'changed_object_type'
198198
)[:20]
199199
changelog_table = ObjectChangeTable(changelog)
200+
changelog_table.configure(request)
200201

201202
return render(request, self.template_name, {
202203
'changelog_table': changelog_table,

netbox/core/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def get_extra_context(self, request, instance):
223223
data=related_changes[:50],
224224
orderable=False
225225
)
226+
related_changes_table.configure(request)
226227

227228
objectchanges = ObjectChange.objects.valid_models().restrict(request.user, 'view').filter(
228229
changed_object_type=instance.changed_object_type,

netbox/dcim/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,6 +2793,7 @@ def get_extra_context(self, request, instance):
27932793
),
27942794
orderable=False
27952795
)
2796+
vdc_table.configure(request)
27962797

27972798
# Get bridge interfaces
27982799
bridge_interfaces = Interface.objects.restrict(request.user, 'view').filter(bridge=instance)
@@ -2801,6 +2802,7 @@ def get_extra_context(self, request, instance):
28012802
exclude=('device', 'parent'),
28022803
orderable=False
28032804
)
2805+
bridge_interfaces_table.configure(request)
28042806

28052807
# Get child interfaces
28062808
child_interfaces = Interface.objects.restrict(request.user, 'view').filter(parent=instance)
@@ -2809,6 +2811,7 @@ def get_extra_context(self, request, instance):
28092811
exclude=('device', 'parent'),
28102812
orderable=False
28112813
)
2814+
child_interfaces_table.configure(request)
28122815

28132816
# Get assigned VLANs and annotate whether each is tagged or untagged
28142817
vlans = []
@@ -2823,6 +2826,7 @@ def get_extra_context(self, request, instance):
28232826
data=vlans,
28242827
orderable=False
28252828
)
2829+
vlan_table.configure(request)
28262830

28272831
# Get VLAN translation rules
28282832
vlan_translation_table = None
@@ -2831,6 +2835,7 @@ def get_extra_context(self, request, instance):
28312835
data=instance.vlan_translation_policy.rules.all(),
28322836
orderable=False
28332837
)
2838+
vlan_translation_table.configure(request)
28342839

28352840
return {
28362841
'vdc_table': vdc_table,

netbox/ipam/views.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ def get_extra_context(self, request, instance):
4545
instance.import_targets.all(),
4646
orderable=False
4747
)
48+
import_targets_table.configure(request)
49+
4850
export_targets_table = tables.RouteTargetTable(
4951
instance.export_targets.all(),
5052
orderable=False
5153
)
54+
export_targets_table.configure(request)
5255

5356
return {
5457
'related_models': self.get_related_models(request, instance, omit=[Interface, VMInterface]),
@@ -530,6 +533,7 @@ def get_extra_context(self, request, instance):
530533
exclude=('vrf', 'utilization'),
531534
orderable=False
532535
)
536+
parent_prefix_table.configure(request)
533537

534538
# Duplicate prefixes table
535539
duplicate_prefixes = Prefix.objects.restrict(request.user, 'view').filter(
@@ -544,6 +548,7 @@ def get_extra_context(self, request, instance):
544548
exclude=('vrf', 'utilization'),
545549
orderable=False
546550
)
551+
duplicate_prefix_table.configure(request)
547552

548553
return {
549554
'aggregate': aggregate,
@@ -709,6 +714,7 @@ def get_extra_context(self, request, instance):
709714
exclude=('vrf', 'utilization'),
710715
orderable=False
711716
)
717+
parent_prefixes_table.configure(request)
712718

713719
return {
714720
'parent_prefixes_table': parent_prefixes_table,
@@ -796,6 +802,7 @@ def get_extra_context(self, request, instance):
796802
exclude=('vrf', 'utilization'),
797803
orderable=False
798804
)
805+
parent_prefixes_table.configure(request)
799806

800807
# Duplicate IPs table
801808
duplicate_ips = IPAddress.objects.restrict(request.user, 'view').filter(
@@ -811,6 +818,7 @@ def get_extra_context(self, request, instance):
811818
duplicate_ips = duplicate_ips.exclude(role=IPAddressRoleChoices.ROLE_ANYCAST)
812819
# Limit to a maximum of 10 duplicates displayed here
813820
duplicate_ips_table = tables.IPAddressTable(duplicate_ips[:10], orderable=False)
821+
duplicate_ips_table.configure(request)
814822

815823
return {
816824
'parent_prefixes_table': parent_prefixes_table,
@@ -888,6 +896,7 @@ def post(self, request):
888896
# Limit to 100 results
889897
addresses = filtersets.IPAddressFilterSet(request.POST, addresses).qs[:100]
890898
table = tables.IPAddressAssignTable(addresses)
899+
table.configure(request)
891900

892901
return render(request, 'ipam/ipaddress_assign.html', {
893902
'form': form,
@@ -1053,6 +1062,8 @@ def get_extra_context(self, request, instance):
10531062
data=instance.rules.all(),
10541063
orderable=False
10551064
)
1065+
vlan_translation_table.configure(request)
1066+
10561067
return {
10571068
'vlan_translation_table': vlan_translation_table,
10581069
}
@@ -1170,6 +1181,7 @@ def get_extra_context(self, request, instance):
11701181
data=FHRPGroupAssignment.objects.restrict(request.user, 'view').filter(group=instance),
11711182
orderable=False
11721183
)
1184+
members_table.configure(request)
11731185
members_table.columns.hide('group')
11741186

11751187
return {
@@ -1289,6 +1301,7 @@ def get_extra_context(self, request, instance):
12891301
'vrf', 'scope', 'role', 'tenant'
12901302
)
12911303
prefix_table = tables.PrefixTable(list(prefixes), exclude=('vlan', 'utilization'), orderable=False)
1304+
prefix_table.configure(request)
12921305

12931306
return {
12941307
'prefix_table': prefix_table,

netbox/users/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ class UserView(generic.ObjectView):
7777
def get_extra_context(self, request, instance):
7878
changelog = ObjectChange.objects.restrict(request.user, 'view').filter(user=instance)[:20]
7979
changelog_table = ObjectChangeTable(changelog)
80+
changelog_table.configure(request)
8081

8182
return {
8283
'changelog_table': changelog_table,

netbox/virtualization/views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ def post(self, request, pk):
350350

351351
selected_objects = Device.objects.filter(pk__in=form.initial['pk'])
352352
device_table = DeviceTable(list(selected_objects), orderable=False)
353+
device_table.configure(request)
353354

354355
return render(request, self.template_name, {
355356
'form': form,
@@ -505,6 +506,7 @@ def get_extra_context(self, request, instance):
505506
exclude=('virtual_machine',),
506507
orderable=False
507508
)
509+
child_interfaces_tables.configure(request)
508510

509511
# Get VLAN translation rules
510512
vlan_translation_table = None
@@ -513,6 +515,7 @@ def get_extra_context(self, request, instance):
513515
data=instance.vlan_translation_policy.rules.all(),
514516
orderable=False
515517
)
518+
vlan_translation_table.configure(request)
516519

517520
# Get assigned VLANs and annotate whether each is tagged or untagged
518521
vlans = []
@@ -527,6 +530,7 @@ def get_extra_context(self, request, instance):
527530
data=vlans,
528531
orderable=False
529532
)
533+
vlan_table.configure(request)
530534

531535
return {
532536
'child_interfaces_table': child_interfaces_tables,

netbox/vpn/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,12 @@ def get_extra_context(self, request, instance):
452452
instance.import_targets.prefetch_related('tenant'),
453453
orderable=False
454454
)
455+
import_targets_table.configure(request)
455456
export_targets_table = RouteTargetTable(
456457
instance.export_targets.prefetch_related('tenant'),
457458
orderable=False
458459
)
460+
export_targets_table.configure(request)
459461

460462
return {
461463
'import_targets_table': import_targets_table,

0 commit comments

Comments
 (0)