2222from .api .views import HostsSet
2323from .base .forms import IpAddressImportForm
2424from .base .models import CsvImportException
25+ from .filters import SubnetFilter , SubnetOrganizationFilter
2526
2627Subnet = swapper .load_model ('openwisp_ipam' , 'Subnet' )
2728IpAddress = swapper .load_model ('openwisp_ipam' , 'IpAddress' )
@@ -46,7 +47,7 @@ class SubnetAdmin(
4647 'created' ,
4748 'modified' ,
4849 ]
49- list_filter = [( 'organization' , MultitenantOrgFilter ) ]
50+ list_filter = [MultitenantOrgFilter ]
5051 autocomplete_fields = ['master_subnet' ]
5152 search_fields = ['subnet' , 'name' ]
5253 list_select_related = ['organization' , 'master_subnet' ]
@@ -218,7 +219,7 @@ class IpAddressAdmin(
218219 form = IpAddressAdminForm
219220 change_form_template = 'admin/openwisp-ipam/ip_address/change_form.html'
220221 list_display = ['ip_address' , 'subnet' , 'organization' , 'created' , 'modified' ]
221- list_filter = ['subnet' , ( 'subnet__organization' , MultitenantOrgFilter ) ]
222+ list_filter = [SubnetOrganizationFilter , SubnetFilter ]
222223 search_fields = ['ip_address' ]
223224 autocomplete_fields = ['subnet' ]
224225 multitenant_parent = 'subnet'
0 commit comments