Closed JeronimoC23 closed 3 years ago
Resuelto con la view: def index(request): today = datetime.today() events = Event.objects.filter(public=True, fecha__gte = today) articles = Article.objects.filter(public=True) subcoms = SubCom.objects.all() fav_articles = Article.objects.filter(fav=True, public=True)
return render(request,'mainapp/index.html',{
'title':'Home',
'events':events,
'articles': articles,
'subcoms':subcoms,
'fav_articles':fav_articles,
})
Y en la template:
{{article.created_at|date:'d/m/Y '}} {{article.author}}
★ Articulo recomendado ★
{% endcomment %}{{article.created_at|date:'d/m/Y '}} {{article.author}}
{{article.created_at|date:'d/m/Y '}} {{article.author}}
Que los articulos que elles destaquen aparezcan primeros en el index y en las paginas particulares de las subcomisiones