Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
a343c91c
Commit
a343c91c
authored
5 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Fallback show info.
parent
8f97401b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/database/broadcasts.py
+25
-1
25 additions, 1 deletion
libraries/database/broadcasts.py
with
25 additions
and
1 deletion
libraries/database/broadcasts.py
+
25
−
1
View file @
a343c91c
...
@@ -43,8 +43,11 @@ from libraries.base.config import AuraConfig
...
@@ -43,8 +43,11 @@ from libraries.base.config import AuraConfig
from
modules.base.simpleutil
import
SimpleUtil
from
modules.base.simpleutil
import
SimpleUtil
# Init Config
config
=
AuraConfig
()
# Initialize DB Model and session
# Initialize DB Model and session
engine
=
sa
.
create_engine
(
AuraC
onfig
()
.
get_database_uri
())
engine
=
sa
.
create_engine
(
c
onfig
.
get_database_uri
())
Base
=
declarative_base
()
Base
=
declarative_base
()
Base
.
metadata
.
bind
=
engine
Base
.
metadata
.
bind
=
engine
...
@@ -555,6 +558,27 @@ class TrackService(DB.Model, AuraDatabaseModel):
...
@@ -555,6 +558,27 @@ class TrackService(DB.Model, AuraDatabaseModel):
return
None
return
None
@hybrid_property
def
show
(
self
):
"""
Retrieves show information based on the related schedule. If no schedule
is available (e.g. when the engine is in a fallback state), then the default
show properties from `AuraConfig` are returned.
"""
show_info
=
{}
if
self
.
schedule
:
show_info
[
"
name
"
]
=
self
.
schedule
.
show_name
show_info
[
"
type
"
]
=
self
.
schedule
.
type
show_info
[
"
host
"
]
=
self
.
show_hosts
.
show_name
elif
self
.
fallback_type
==
4
:
show_info
[
"
name
"
]
=
config
.
get
(
"
fallback_show_name
"
)
show_info
[
"
type
"
]
=
config
.
get
(
"
fallback_show_type
"
)
show_info
[
"
host
"
]
=
config
.
get
(
"
fallback_show_host
"
)
return
show_info
@staticmethod
@staticmethod
def
select_one
(
id
):
def
select_one
(
id
):
"""
"""
...
...
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