Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
panikweb
Commits
782de96a
Commit
782de96a
authored
Aug 23, 2013
by
fred
Browse files
performance: compute queries for home page in context
parent
d5333e39
Changes
1
Hide whitespace changes
Inline
Side-by-side
panikweb/views.py
View file @
782de96a
...
...
@@ -169,9 +169,10 @@ class Home(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
Home
,
self
).
get_context_data
(
**
kwargs
)
context
[
'newsImaged'
]
=
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
3
]
context
[
'news'
]
=
NewsItem
.
objects
.
all
().
order_by
(
'-datetime'
)[:
60
]
context
[
'emissions'
]
=
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
)
context
[
'newsImaged'
]
=
list
(
NewsItem
.
objects
.
all
().
exclude
(
image__isnull
=
True
).
exclude
(
image__exact
=
''
).
order_by
(
'-datetime'
)[:
3
])
context
[
'news'
]
=
list
(
NewsItem
.
objects
.
all
().
order_by
(
'-datetime'
)[:
60
])
context
[
'emissions'
]
=
list
(
Emission
.
objects
.
filter
(
archived
=
False
).
order_by
(
'title'
))
context
[
'player'
]
=
audioPlayer
()
return
context
...
...
Write
Preview
Markdown
is supported
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