Tri des articles par date de création décroissante dans le context_processor.
This commit is contained in:
parent
5fd06f5ae1
commit
afa673ccd9
1 changed files with 1 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from .models import Post
|
||||
|
||||
def posts_list(request):
|
||||
posts = Post.objects.all()
|
||||
posts = Post.objects.all().order_by('-created_at')
|
||||
return {'posts': posts}
|
||||
Loading…
Add table
Add a link
Reference in a new issue