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
panikdb
Commits
35b4754b
Commit
35b4754b
authored
Aug 30, 2013
by
fred
Browse files
edit: prefill duration when adding an episode
parent
d4aaf49f
Changes
1
Hide whitespace changes
Inline
Side-by-side
panikdb/emissions/views.py
View file @
35b4754b
...
@@ -101,6 +101,7 @@ class EpisodeCreateView(CreateView):
...
@@ -101,6 +101,7 @@ class EpisodeCreateView(CreateView):
def
get_initial
(
self
):
def
get_initial
(
self
):
initial
=
super
(
EpisodeCreateView
,
self
).
get_initial
()
initial
=
super
(
EpisodeCreateView
,
self
).
get_initial
()
initial
[
'emission'
]
=
Emission
.
objects
.
get
(
slug
=
self
.
kwargs
.
get
(
'emission_slug'
))
initial
[
'emission'
]
=
Emission
.
objects
.
get
(
slug
=
self
.
kwargs
.
get
(
'emission_slug'
))
initial
[
'duration'
]
=
initial
[
'emission'
].
duration
return
initial
return
initial
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
...
...
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