mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Fix bug recherche, divers améliorations
This commit is contained in:
parent
ff18296ccb
commit
e482e0e7e1
3 changed files with 8 additions and 6 deletions
|
@ -47,15 +47,17 @@ def search_result(search, type, request):
|
|||
|
||||
connexion = []
|
||||
|
||||
recherche = {'users_list': None, 'machines_list' : None, 'facture_list' : None, 'ban_list' : None, 'white_list': None, 'port_list': None, 'switch_list': None}
|
||||
recherche = {'users_list': None, 'machines_list' : [], 'facture_list' : None, 'ban_list' : None, 'white_list': None, 'port_list': None, 'switch_list': None}
|
||||
|
||||
query = Q(user__pseudo__icontains = search) | Q(user__name__icontains = search) | Q(user__surname__icontains = search)
|
||||
|
||||
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)) & query1)
|
||||
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':
|
||||
recherche['machines_list'] = Machine.objects.filter(query | Q(interface__dns__icontains = search) | Q(interface__mac_address__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(dns__icontains = search) | Q(mac_address__icontains = search) | Q(ipv4__ipv4__icontains = search))
|
||||
for d in data:
|
||||
recherche['machines_list'].append(d.machine)
|
||||
if i == '2':
|
||||
recherche['facture_list'] = Facture.objects.filter(query & date_query)
|
||||
if i == '3':
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<th>Prénom</th>
|
||||
<th>Nom</th>
|
||||
<th>Pseudo</th>
|
||||
<th>Uid</th>
|
||||
<th>Chambre</th>
|
||||
<th>Fin de cotisation le</th>
|
||||
<th>Connexion</th>
|
||||
<th>Profil</th>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<td>{{ user.name }}</td>
|
||||
<td>{{ user.surname }}</td>
|
||||
<td>{{ user.pseudo }}</td>
|
||||
<td>{{ user.uid_number }}</td>
|
||||
<td>{{ user.room }}</td>
|
||||
<td>{% if user.is_adherent %}{{ user.end_adhesion }}{% else %}Non adhérent{% endif %}</td>
|
||||
<td>{% if user.has_access == True %}
|
||||
<font color="green">Active</font>
|
||||
|
|
|
@ -426,7 +426,7 @@ def del_listright(request):
|
|||
@permission_required('cableur')
|
||||
def index(request):
|
||||
""" Affiche l'ensemble des users, need droit cableur """
|
||||
users_list = User.objects.order_by('pk')
|
||||
users_list = User.objects.order_by('state', 'name')
|
||||
paginator = Paginator(users_list, PAGINATION_NUMBER)
|
||||
page = request.GET.get('page')
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue