viktor.core
UserException
- exception viktor.core.UserException(*args)¶
Bases:
Exception
Deprecated, please use
viktor.errors.UserError
instead.
InitialEntity
- class viktor.core.InitialEntity(entity_type_name, name, *, params=None, children=None, show_on_dashboard=None)¶
-
Construct an initial entity in the app.__init__py file.
from .settings_database.controller import Controller as SettingsDatabaseController from .project_folder.controller import Controller as ProjectFolderController from .project.controller import Controller as ProjectController from viktor import InitialEntity initial_entities = [ InitialEntity('SettingsDatabase', name='Settings', params=...), InitialEntity('ProjectFolder', name='Projects', children=[ InitialEntity('Project', 'Project X), InitialEntity('Project', 'Project Y), ]), ]
- Parameters
entity_type_name (
str
) – Type of the initial entity.name (
str
) – Name of the initial entity.params (
Union
[dict
,str
,None
]) – Optional params in dictionary format or path to a .json, relative to the app.__init__.py. Note that path traversal (beyond the root directory) is not permitted (e.g. “../../entity.json”).children (
Optional
[List
[InitialEntity
]]) – Optional child entities.show_on_dashboard (
Optional
[bool
]) – Show/hide the entity on the dashboard. Only top-level entities can be shown (default: True)New in v13.7.0