new file: projetCuf/__init__.py
[univ_ap.git] / portail / views.py
1 # Create your views here.
2 from django.shortcuts import render
3 #from news.models import News
4 from django.http import Http404
5 from django.shortcuts import redirect
6 from news.models import News
7
8
9 def portail(request):
10 listnews1 = News.objects.filter(categorie = 2,statut='Publie').order_by('-date_debut')[0:1]
11 listnews2 = News.objects.filter(categorie = 2,statut='Publie').order_by('-date_debut')[1:2]
12 listnews3 = News.objects.filter(categorie = 2,statut='Publie').order_by('-date_debut')[2:3]
13 listnews4 = News.objects.filter(categorie = 2,statut='Publie').order_by('-date_debut')[3:4]
14 listnews5 = News.objects.filter(categorie = 2,statut='Publie').order_by('-date_debut')[4:5]
15 listnews6 = News.objects.filter(categorie = 2,statut='Publie').order_by('-date_debut')[5:6]
16 domain = 'http://www.veille.univ-ap.info/'
17 return render(request,'portail/portal.html', locals())