Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
limbra
limbra
Commits
8f5e8278
Commit
8f5e8278
authored
Apr 28, 2017
by
LE GAC Renaud
Browse files
Update main to instantiate only the part of the model required by a controller.
parent
9fef7986
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
64 deletions
+73
-64
models/main.py
models/main.py
+73
-64
No files found.
models/main.py
View file @
8f5e8278
...
...
@@ -81,78 +81,87 @@ T.lazy = True # immediate translation
# Configure plugin_dbui
#
Dbui
.
define_paths
(
app_css
=
"static/my.css"
,
app_lg
=
"static/limbra/locale/limbra-lang-fr.js"
,
app_libmin
=
"static/limbra-min.js"
,
app_script
=
"static/app.js"
)
ctrl
=
request
.
controller
fnct
=
request
.
function
if
ctrl
==
"plugin_dbui"
and
fnct
in
(
"about"
,
"index"
):
Dbui
.
define_paths
(
app_css
=
"static/my.css"
,
app_lg
=
"static/limbra/locale/limbra-lang-fr.js"
,
app_libmin
=
"static/limbra-min.js"
,
app_script
=
"static/app.js"
)
# ............................................................................
#
# Create the database models
#
App
.
define_tables
(
db
,
T
)
Core
.
define_tables
(
db
,
T
)
Harvester
.
define_tables
(
db
,
T
)
Report
.
define_tables
(
db
,
T
)
Selector
.
define_tables
(
virtdb
,
db
,
T
)
if
ctrl
!=
"plugin_dbui"
or
fnct
in
(
"call"
,
"csv"
,
"dbui_conf"
):
App
.
define_tables
(
db
,
T
)
Core
.
define_tables
(
db
,
T
)
Harvester
.
define_tables
(
db
,
T
)
Report
.
define_tables
(
db
,
T
)
Selector
.
define_tables
(
virtdb
,
db
,
T
)
# ............................................................................
#
# Configure the user interface
#
Dbui
.
initialise_ui
()
directSvc
=
Dbui
.
start_directSvc
()
# common configuration for forms and grids
tables
=
[
"application"
,
"auth_group"
,
"auth_membership"
,
"auth_user"
,
"authors_roles"
,
"axes"
,
"categories"
,
"collaborations"
,
"controllers"
,
"countries"
,
"harvesters"
,
"graphs"
,
"lists"
,
"metrics"
,
"my_authors"
,
"organisation"
,
"projects"
,
"publications"
,
"publishers"
,
"renderers"
,
"reports"
,
"sections"
,
"status"
,
"teams"
]
# a user see the categories table but he/she can not modify it.
if
session
.
role
==
USER
:
tables
.
remove
(
"categories"
)
configure_forms
(
tables
,
plugins
=
[
"pFormToolTip"
],
width
=
350
)
configure_grids
(
tables
,
plugins
=
[
"pGridRowEditorConfirmDelete"
,
"pGridRowEditorContextMenu"
,
"pGridRowEditorDblClick"
,
"pGridToolbar"
])
AppUI
.
configure
(
db
,
T
)
AuthUI
.
configure
(
db
,
T
)
CoreUI
.
configure
(
db
,
T
)
HarvesterUI
.
configure
(
db
,
T
)
ReportUI
.
configure
(
db
,
T
)
SelectorUI
.
configure
(
virtdb
,
db
,
T
)
ViewportUi
.
configure
(
db
,
T
,
virtdb
)
if
ctrl
==
"plugin_dbui"
and
fnct
in
(
"call"
,
"dbui_conf"
):
Dbui
.
initialise_ui
()
directSvc
=
Dbui
.
start_directSvc
()
# common configuration for forms and grids
tables
=
[
"application"
,
"auth_group"
,
"auth_membership"
,
"auth_user"
,
"authors_roles"
,
"axes"
,
"categories"
,
"collaborations"
,
"controllers"
,
"countries"
,
"harvesters"
,
"graphs"
,
"lists"
,
"metrics"
,
"my_authors"
,
"organisation"
,
"projects"
,
"publications"
,
"publishers"
,
"renderers"
,
"reports"
,
"sections"
,
"status"
,
"teams"
]
# a user see the categories table but he/she can not modify it.
if
session
.
role
==
USER
:
tables
.
remove
(
"categories"
)
configure_forms
(
tables
,
plugins
=
[
"pFormToolTip"
],
width
=
350
)
configure_grids
(
tables
,
plugins
=
[
"pGridRowEditorConfirmDelete"
,
"pGridRowEditorContextMenu"
,
"pGridRowEditorDblClick"
,
"pGridToolbar"
])
AppUI
.
configure
(
db
,
T
)
AuthUI
.
configure
(
db
,
T
)
CoreUI
.
configure
(
db
,
T
)
HarvesterUI
.
configure
(
db
,
T
)
ReportUI
.
configure
(
db
,
T
)
SelectorUI
.
configure
(
virtdb
,
db
,
T
)
# configure the viewport
if
fnct
==
"dbui_conf"
:
ViewportUi
.
configure
(
db
,
T
,
virtdb
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment