19380 call configure on embedded tables

This commit is contained in:
Arthur 2025-05-02 11:31:29 -07:00
parent 7672ad74e9
commit b20d2770d8
7 changed files with 14 additions and 0 deletions

View File

@ -197,6 +197,7 @@ class ProfileView(LoginRequiredMixin, View):
'changed_object_type' 'changed_object_type'
)[:20] )[:20]
changelog_table = ObjectChangeTable(changelog) changelog_table = ObjectChangeTable(changelog)
changelog_table.configure(request)
return render(request, self.template_name, { return render(request, self.template_name, {
'changelog_table': changelog_table, 'changelog_table': changelog_table,

View File

@ -2826,6 +2826,7 @@ class InterfaceView(generic.ObjectView):
data=vlans, data=vlans,
orderable=False orderable=False
) )
vlan_table.configure(request)
# Get VLAN translation rules # Get VLAN translation rules
vlan_translation_table = None vlan_translation_table = None
@ -2834,6 +2835,7 @@ class InterfaceView(generic.ObjectView):
data=instance.vlan_translation_policy.rules.all(), data=instance.vlan_translation_policy.rules.all(),
orderable=False orderable=False
) )
vlan_translation_table.configure(request)
return { return {
'vdc_table': vdc_table, 'vdc_table': vdc_table,

View File

@ -46,6 +46,7 @@ class VRFView(GetRelatedModelsMixin, generic.ObjectView):
orderable=False orderable=False
) )
import_targets_table.configure(request) import_targets_table.configure(request)
export_targets_table = tables.RouteTargetTable( export_targets_table = tables.RouteTargetTable(
instance.export_targets.all(), instance.export_targets.all(),
orderable=False orderable=False
@ -895,6 +896,7 @@ class IPAddressAssignView(generic.ObjectView):
# Limit to 100 results # Limit to 100 results
addresses = filtersets.IPAddressFilterSet(request.POST, addresses).qs[:100] addresses = filtersets.IPAddressFilterSet(request.POST, addresses).qs[:100]
table = tables.IPAddressAssignTable(addresses) table = tables.IPAddressAssignTable(addresses)
table.configure(request)
return render(request, 'ipam/ipaddress_assign.html', { return render(request, 'ipam/ipaddress_assign.html', {
'form': form, 'form': form,
@ -1060,6 +1062,8 @@ class VLANTranslationPolicyView(GetRelatedModelsMixin, generic.ObjectView):
data=instance.rules.all(), data=instance.rules.all(),
orderable=False orderable=False
) )
vlan_translation_table.configure(request)
return { return {
'vlan_translation_table': vlan_translation_table, 'vlan_translation_table': vlan_translation_table,
} }

View File

@ -100,6 +100,7 @@ class SearchView(ConditionalLoginRequiredMixin, View):
highlight = form.cleaned_data['q'] highlight = form.cleaned_data['q']
table = SearchTable(results, highlight=highlight) table = SearchTable(results, highlight=highlight)
table.configure(request)
# Paginate the table results # Paginate the table results
RequestConfig(request, { RequestConfig(request, {

View File

@ -77,6 +77,7 @@ class UserView(generic.ObjectView):
def get_extra_context(self, request, instance): def get_extra_context(self, request, instance):
changelog = ObjectChange.objects.restrict(request.user, 'view').filter(user=instance)[:20] changelog = ObjectChange.objects.restrict(request.user, 'view').filter(user=instance)[:20]
changelog_table = ObjectChangeTable(changelog) changelog_table = ObjectChangeTable(changelog)
changelog_table.configure(request)
return { return {
'changelog_table': changelog_table, 'changelog_table': changelog_table,

View File

@ -350,6 +350,7 @@ class ClusterRemoveDevicesView(generic.ObjectEditView):
selected_objects = Device.objects.filter(pk__in=form.initial['pk']) selected_objects = Device.objects.filter(pk__in=form.initial['pk'])
device_table = DeviceTable(list(selected_objects), orderable=False) device_table = DeviceTable(list(selected_objects), orderable=False)
device_table.configure(request)
return render(request, self.template_name, { return render(request, self.template_name, {
'form': form, 'form': form,
@ -514,6 +515,7 @@ class VMInterfaceView(generic.ObjectView):
data=instance.vlan_translation_policy.rules.all(), data=instance.vlan_translation_policy.rules.all(),
orderable=False orderable=False
) )
vlan_translation_table.configure(request)
# Get assigned VLANs and annotate whether each is tagged or untagged # Get assigned VLANs and annotate whether each is tagged or untagged
vlans = [] vlans = []
@ -528,6 +530,7 @@ class VMInterfaceView(generic.ObjectView):
data=vlans, data=vlans,
orderable=False orderable=False
) )
vlan_table.configure(request)
return { return {
'child_interfaces_table': child_interfaces_tables, 'child_interfaces_table': child_interfaces_tables,

View File

@ -452,10 +452,12 @@ class L2VPNView(generic.ObjectView):
instance.import_targets.prefetch_related('tenant'), instance.import_targets.prefetch_related('tenant'),
orderable=False orderable=False
) )
import_targets_table.configure(request)
export_targets_table = RouteTargetTable( export_targets_table = RouteTargetTable(
instance.export_targets.prefetch_related('tenant'), instance.export_targets.prefetch_related('tenant'),
orderable=False orderable=False
) )
export_targets_table.configure(request)
return { return {
'import_targets_table': import_targets_table, 'import_targets_table': import_targets_table,