1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-12-25 05:02:24 +00:00

Reglages dans settings

This commit is contained in:
Med 2017-07-03 02:41:14 +02:00
parent aebeba5ddb
commit 760e309afb

View File

@ -33,6 +33,8 @@ from django.db.models import Q
from users.models import User
from search.forms import SearchForm, SearchFormPlus
from med.settings import SEARCH_DISPLAY_PAGE
from media.models import Media, Emprunt
def form(ctx, template, 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()
if i == '2':
recherche['medias_list'] = Media.objects.filter(Q(auteur__nom__icontains = search) | Q(titre__icontains = search))
search_display_page = 5
for r in recherche:
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