Commit d8a73a45 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

Optimisation sur le menu d'edition d'une machine (accèlère)

parent 0b070288
......@@ -26,6 +26,8 @@ from .models import Domain, Machine, Interface, IpList, MachineType, Extension,
from django.db.models import Q
from django.core.validators import validate_email
from users.models import User
class EditMachineForm(ModelForm):
class Meta:
model = Machine
......@@ -53,6 +55,7 @@ class EditInterfaceForm(ModelForm):
self.fields['mac_address'].label = 'Adresse mac'
self.fields['type'].label = 'Type de machine'
self.fields['type'].empty_label = "Séléctionner un type de machine"
self.fields['machine'].queryset = Machine.objects.all().select_related('user')
def clean(self):
data = super(EditInterfaceForm, self).clean()
......
......@@ -751,7 +751,7 @@ def mac_ip_list(request):
@login_required
@permission_required('serveur')
def alias(request):
alias = Domain.objects.filter(interface_parent=None).filter(cname=Domain.objects.filter(interface_parent__in=Interface.objects.exclude(ipv4=None)))
alias = Domain.objects.filter(interface_parent=None).filter(cname=Domain.objects.filter(interface_parent__in=Interface.objects.exclude(ipv4=None))).select_related('extension')
seria = DomainSerializer(alias, many=True)
return JSONResponse(seria.data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment