Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend_common_py
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
videoag
backend_common_py
Commits
c805d09b
Commit
c805d09b
authored
4 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Disallow creation of media objects
parent
a485745c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/videoag_common/objects/medium.py
+10
-2
10 additions, 2 deletions
src/videoag_common/objects/medium.py
with
10 additions
and
2 deletions
src/videoag_common/objects/medium.py
+
10
−
2
View file @
c805d09b
...
...
@@ -38,6 +38,9 @@ _SOURCE_MEDIUM_STATUS_ENUM = create_enum_type(SourceMediumStatus)
# A file which was uploaded and needs to be assigned to a lecture, to be converted to a SourceFileTargetMedium
class
SourceMedium
(
DeletableApiObject
,
Base
):
__api_class__
=
ApiObjectClass
(
config_allow_creation
=
False
)
__table_args__
=
(
CheckConstraint
(
"
NOT tag IS NULL OR lecture_id IS NULL
"
,
...
...
@@ -211,6 +214,9 @@ class TargetMedium(DeletableApiObject, Base):
name
=
"
check_video_frame_rate_denominator_not_null
"
),
)
__api_class__
=
ApiObjectClass
(
config_allow_creation
=
False
)
# Note that these four may NOT be unique. E.g. if one output is generated twice (because another output of the same
# producer was deleted, etc.)
...
...
@@ -459,10 +465,12 @@ class ImageTargetMedium(TargetMedium, FileMedium, SingleImageContainingMedium):
class
PublishMedium
(
VisibilityApiObject
,
DeletableApiObject
,
Base
):
__api_data__
=
ApiObjectClass
(
parent_relationship_config_ids
=
[
"
lecture
"
]
__api_class__
=
ApiObjectClass
(
parent_relationship_config_ids
=
[
"
lecture
"
],
config_allow_creation
=
False
)
# TODO why do we have the lecture_id if the target_medium already has that?
lecture_id
:
Mapped
[
int
]
=
mapped_column
(
ForeignKey
(
"
lecture.id
"
),
nullable
=
False
,
index
=
True
)
title
:
Mapped
[
str
]
=
api_mapped
(
mapped_column
(
Text
(
collation
=
STRING_COLLATION
),
nullable
=
False
,
default
=
""
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment