Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 43deb0a3 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Optimize models with respect to controller/function.

parent b120b61e
......@@ -13,6 +13,9 @@ from plugin_event import (EvtModelCore,
EvtUiSelector,
EvtUiViewport)
ctrl = request.controller
fnct = request.function
#.............................................................................
#
# Language
......@@ -26,68 +29,71 @@ T.lazy = False # immediate translation
#
# Plugin dbui configuration
#
is_dbui = (ctrl == "plugin_dbui") and \
fnct in ("debug", "documentations", "dbui_conf", "index")
dbui.Dbui.initialise(
app_css="static/track_events/resources/css/my.css",
app_debug="static/track_events/src",
app_lg="static/track_events/locale/myapp-lang-fr.js",
app_libmin="static/track_events-min.js",
app_script="static/app.js")
directSvc = dbui.Dbui.start_directSvc()
if is_dbui:
dbui.Dbui.initialise_paths(
app_css="static/track_events/resources/css/my.css",
app_debug="static/track_events/src",
app_lg="static/track_events/locale/myapp-lang-fr.js",
app_libmin="static/track_events-min.js",
app_script="static/app.js")
#.............................................................................
#
# Create the database models
#
EvtModelCore(db, T)
EvtModelReport(db, T)
EvtModelSelector(virtdb, db, T)
#.............................................................................
#
# Common configuration for forms and grids
#
tables = ["auth_group",
"auth_membership",
"auth_user",
"domains",
"events",
"fundings",
"graphs",
"history",
"lists",
"metrics1d",
"metrics2d",
"object_categories",
"objects",
"people",
"people_categories",
"projects",
"teams"]
dbui.configure_forms(tables, plugins=["pFormToolTip"], width=350)
dbui.configure_grids(tables, plugins=["pGridRowEditorConfirmDelete",
"pGridRowEditorContextMenu",
"pGridRowEditorDblClick",
"pGridToolbar"])
#.............................................................................
#
# Tune the user interface
#
EvtUiCore(db, T)
EvtUiReport(db, T)
is_db = (ctrl == "plugin_dbui" and fnct in ("call", "csv", "dbui_conf")) or \
(ctrl == "report")
selector_panel = EvtUiSelector.selector(virtdb, db, T)
if is_db:
EvtModelCore(db, T)
EvtModelReport(db, T)
EvtModelSelector(virtdb, db, T)
#.............................................................................
#
# Configure the main viewport
# Configure the user interface
#
EvtUiViewport(db, T, selector_panel)
\ No newline at end of file
if ctrl == "plugin_dbui" and fnct in ("call", "dbui_conf"):
dbui.Dbui.initialise_ui()
directSvc = dbui.Dbui.start_directSvc()
# common configuration for forms and grids
tables = ["auth_group",
"auth_membership",
"auth_user",
"domains",
"events",
"fundings",
"graphs",
"history",
"lists",
"metrics1d",
"metrics2d",
"object_categories",
"objects",
"people",
"people_categories",
"projects",
"teams"]
dbui.configure_forms(tables, plugins=["pFormToolTip"], width=350)
dbui.configure_grids(tables, plugins=["pGridRowEditorConfirmDelete",
"pGridRowEditorContextMenu",
"pGridRowEditorDblClick",
"pGridToolbar"])
# tune the user interface
EvtUiCore(db, T)
EvtUiReport(db, T)
selector_panel = EvtUiSelector.selector(virtdb, db, T)
# configure the main viewport
EvtUiViewport(db, T, selector_panel)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment