1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fixed Prefix list hierarchy

This commit is contained in:
Jeremy Stretch
2016-03-07 12:56:37 -05:00
parent fae4655399
commit 284256777f
2 changed files with 11 additions and 0 deletions

View File

@@ -328,6 +328,11 @@ class PrefixListView(ObjectListView):
edit_table_permissions = ['ipam.change_prefix', 'ipam.delete_prefix']
template_name = 'ipam/prefix_list.html'
def alter_queryset(self, request):
# Show only top-level prefixes by default
limit = None if request.GET.get('expand') else 0
return self.queryset.annotate_depth(limit=limit)
def prefix(request, pk):