8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-27 01:13:46 +00:00
This commit is contained in:
Gabriel Detraz 2016-12-26 19:45:43 +01:00 committed by root
parent 133d83f282
commit 72ec33d967
2 changed files with 5 additions and 1 deletions

View file

@ -154,6 +154,10 @@ class NsForm(ModelForm):
model = Ns model = Ns
fields = ['zone', 'ns'] fields = ['zone', 'ns']
def __init__(self, *args, **kwargs):
super(NsForm, self).__init__(*args, **kwargs)
self.fields['ns'].queryset = Domain.objects.exclude(interface_parent=None)
class DelNsForm(ModelForm): class DelNsForm(ModelForm):
ns = forms.ModelMultipleChoiceField(queryset=Ns.objects.all(), label="Enregistrements NS actuels", widget=forms.CheckboxSelectMultiple) ns = forms.ModelMultipleChoiceField(queryset=Ns.objects.all(), label="Enregistrements NS actuels", widget=forms.CheckboxSelectMultiple)

View file

@ -55,7 +55,7 @@ def search_result(search, type, request):
if i == '0': if i == '0':
recherche['users_list'] = User.objects.filter((Q(room__name__icontains = search) | Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) & query1).order_by('state', 'surname') recherche['users_list'] = User.objects.filter((Q(room__name__icontains = search) | Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) & query1).order_by('state', 'surname')
if i == '1': if i == '1':
data = Interface.objects.filter(Q(machine__user__pseudo__icontains = search) | Q(machine__user__name__icontains = search) | Q(machine__user__surname__icontains = search) | Q(mac_address__icontains = search) | Q(ipv4__ipv4__icontains = search)) data = Interface.objects.filter(Q(machine__user__pseudo__icontains = search) | Q(machine__user__name__icontains = search) | Q(machine__user__surname__icontains = search) | Q(mac_address__icontains = search) | Q(ipv4__ipv4__icontains = search) | Q(domain__name__icontains = search) | Q(domain__related_domain__name__icontains = search))
for d in data: for d in data:
recherche['machines_list'].append(d.machine) recherche['machines_list'].append(d.machine)
if i == '2': if i == '2':