Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
radiopanik
panikweb
Commits
5e2ce24e
Commit
5e2ce24e
authored
Aug 23, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
performance: compute queries in context (not in every nested templates)
parent
3b192ad0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
panikweb/views.py
panikweb/views.py
+3
-3
No files found.
panikweb/views.py
View file @
5e2ce24e
...
...
@@ -182,9 +182,9 @@ class News(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
News
,
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
[
'categories'
]
=
NewsCategory
.
objects
.
all
()
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
[
'categories'
]
=
list
(
NewsCategory
.
objects
.
all
()
)
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