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
b0f18775
Commit
b0f18775
authored
Sep 18, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add distinct() to querysets creating first_diffusion, to avoid duplicates
parent
1c3d993e
Changes
1
Show 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 @
b0f18775
...
...
@@ -53,7 +53,7 @@ class EmissionMixin:
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id)'''
],
tables
=
[
'emissions_diffusion'
],
).
order_by
(
'-first_diffusion'
)
).
order_by
(
'-first_diffusion'
)
.
distinct
()
# get all related soundfiles in a single query
soundfiles
=
{}
...
...
@@ -422,7 +422,7 @@ class Home(TemplateView):
where
=
[
'''datetime = (SELECT MIN(datetime)
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id)'''
],
tables
=
[
'emissions_diffusion'
],).
order_by
(
'-first_diffusion'
)
[:
6
]
tables
=
[
'emissions_diffusion'
],).
order_by
(
'-first_diffusion'
)
.
distinct
()
[:
6
]
context
[
'newsletter_form'
]
=
SubscribeForm
()
...
...
@@ -509,7 +509,7 @@ class Listen(TemplateView):
where
=
[
'''datetime = (SELECT MIN(datetime)
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id)'''
],
tables
=
[
'emissions_diffusion'
],).
order_by
(
'-first_diffusion'
)
[:
10
]
tables
=
[
'emissions_diffusion'
],).
order_by
(
'-first_diffusion'
)
.
distinct
()
[:
10
]
context
[
'categories'
]
=
Category
.
objects
.
all
()
...
...
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