Commit 760e309a authored by Mediatek's avatar Mediatek

Reglages dans settings

parent aebeba5d
...@@ -33,6 +33,8 @@ from django.db.models import Q ...@@ -33,6 +33,8 @@ from django.db.models import Q
from users.models import User from users.models import User
from search.forms import SearchForm, SearchFormPlus from search.forms import SearchForm, SearchFormPlus
from med.settings import SEARCH_DISPLAY_PAGE
from media.models import Media, Emprunt from media.models import Media, Emprunt
def form(ctx, template, request): def form(ctx, template, request):
...@@ -83,13 +85,12 @@ def search_result(search, type, request): ...@@ -83,13 +85,12 @@ def search_result(search, type, request):
recherche['emprunts_list'] = Emprunt.objects.filter(query & date_query).order_by('date_emprunt').reverse() recherche['emprunts_list'] = Emprunt.objects.filter(query & date_query).order_by('date_emprunt').reverse()
if i == '2': if i == '2':
recherche['medias_list'] = Media.objects.filter(Q(auteur__nom__icontains = search) | Q(titre__icontains = search)) recherche['medias_list'] = Media.objects.filter(Q(auteur__nom__icontains = search) | Q(titre__icontains = search))
search_display_page = 5
for r in recherche: for r in recherche:
if recherche[r] != None: if recherche[r] != None:
recherche[r] = recherche[r][:search_display_page] recherche[r] = recherche[r][:SEARCH_DISPLAY_PAGE]
recherche.update({'max_result': search_display_page}) recherche.update({'max_result': SEARCH_DISPLAY_PAGE})
return recherche return recherche
......
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