Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pole-Web
Website
Commits
2d049728
Commit
2d049728
authored
Sep 03, 2021
by
HEVELINE Thomas
Browse files
affichage d'un peu plus de news
parent
52789a1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
news/views.py
View file @
2d049728
...
...
@@ -9,7 +9,7 @@ from . import models
def
index
(
request
):
context
=
{
'news'
:
models
.
New
.
objects
.
order_by
(
'pub_date'
).
all
().
reverse
().
select_related
(
'author__profile'
).
annotate
(
nb_comments
=
Count
(
'comments'
))[:
1
0
],
'news'
:
models
.
New
.
objects
.
order_by
(
'pub_date'
).
all
().
reverse
().
select_related
(
'author__profile'
).
annotate
(
nb_comments
=
Count
(
'comments'
))[:
2
0
],
}
return
render
(
request
,
"news/index.html"
,
context
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment