mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Normalement ca devrait remarcher ce que je voulais faire remarcher
This commit is contained in:
parent
9efc81644f
commit
55cd3b3dbb
1 changed files with 6 additions and 7 deletions
|
@ -41,10 +41,9 @@ def search_result(search, type, request):
|
|||
if date_fin != None:
|
||||
date_query = date_query & Q(date__lte=date_fin)
|
||||
search = search.cleaned_data['search_field']
|
||||
query = Q()
|
||||
query1 = Q()
|
||||
for s in states:
|
||||
query = query | Q(state = s)
|
||||
|
||||
query1 = query1 | Q(state = s)
|
||||
|
||||
connexion = []
|
||||
|
||||
|
@ -54,7 +53,7 @@ def search_result(search, type, request):
|
|||
|
||||
for i in aff:
|
||||
if i == '0':
|
||||
recherche['users_list'] = User.objects.filter(Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search))
|
||||
recherche['users_list'] = User.objects.filter((Q(pseudo__icontains = search) | Q(name__icontains = search) | Q(surname__icontains = search)) & query1)
|
||||
if i == '1':
|
||||
recherche['machines_list'] = Machine.objects.filter(query | Q(interface__dns__icontains = search) | Q(interface__mac_address__icontains = search))
|
||||
if i == '2':
|
||||
|
|
Loading…
Reference in a new issue