Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONE] edit completion/views #838

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions pod/completion/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
def get_video_completion_context(video,
list_contributor=None,
list_document=None,
list_track=None,
list_overlay=None,
form_contributor=None,
form_document=None,
form_track=None,
form_overlay=None):
"""
Returns a dictionary containing information extracted from the video
and its associated objects
(video, list of contributors, list of documents, track and overlay,
as well as forms for creating or updating these objects)
"""
if list_contributor is None:
list_contributor = video.contributor_set.all()
if list_document is None:
list_document = video.document_set.all()
if list_track is None:
list_track = video.track_set.all()
if list_overlay is None:
list_overlay = video.overlay_set.all()

context = {
"video": video,
"list_contributor": list_contributor,
"list_document": list_document,
"list_track": list_track,
"list_overlay": list_overlay,
"form_contributor": form_contributor,
"form_document": form_document,
"form_track": form_track,
"form_overlay": form_overlay
}

return context
Loading