8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Test to improve mac_ip REST speed.

This commit is contained in:
David Sinquin 2017-01-28 15:19:32 +01:00
parent d85452b0c0
commit 0a1173471a

View file

@ -734,6 +734,18 @@ def interface_list(request):
seria = InterfaceSerializer(interface, many=True) seria = InterfaceSerializer(interface, many=True)
return seria.data return seria.data
@csrf_exempt
@login_required
@permission_required('serveur')
def mac_ip_list(request):
interfaces = Interface.objects.all()
filter(
lambda interface: interface.ipv4 and interface.is_active(),
interfaces
)
seria = InterfaceSerializer(interfaces, many=True)
return seria.data
@csrf_exempt @csrf_exempt
@login_required @login_required
@permission_required('serveur') @permission_required('serveur')
@ -778,7 +790,7 @@ def zones(request):
@login_required @login_required
@permission_required('serveur') @permission_required('serveur')
def mac_ip(request): def mac_ip(request):
seria = interface_list(request) seria = mac_ip_list(request)
return JSONResponse(seria) return JSONResponse(seria)
@csrf_exempt @csrf_exempt