Skip to content
Snippets Groups Projects
Commit 24cb2446 authored by legac's avatar legac
Browse files

Add the plugin.dbui variable app_git.

parent 18d749b5
No related branches found
No related tags found
2 merge requests!4Release 0.6.5,!11 branching model
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-s
""" Common settings
"""
import locale
import plugin_dbui as dbui
from callbacks import country_delete, country_insert, country_update
from callbacks import country_delete, country_insert, country_update
from datetime import datetime
from gluon.tools import PluginManager
......@@ -15,22 +15,23 @@ from gluon.tools import PluginManager
#
#-------------------------------------------------------------------------------
plugins = PluginManager()
#plugins.dbui.app_css = None # relative path, i.e static/myapp.css or dir or list
#plugins.dbui.app_js = None # relative path static/src/my.js or dir or list
#plugins.dbui.app_libmin = None # relative path static/myapp-min.js or dir or list
plugins.dbui.app_script = 'static/app.js' # relative path static/myapp.js
# plugins.dbui.app_css = None # relative path, i.e static/myapp.css or dir or list
# plugins.dbui.app_js = None # relative path static/src/my.js or dir or list
plugins.dbui.app_git = "https://gitlab.in2p3.fr/legac/%s.git" % request.application
# plugins.dbui.app_libmin = None # relative path static/myapp-min.js or dir or list
plugins.dbui.app_script = 'static/app.js' # relative path static/myapp.js
plugins.dbui.app_script_dir = 'static/scripts' # relative directory static/scripts
#plugins.dbui.dbui_libmin='static/plugin_dbui/dbui-debug.js'
# plugins.dbui.dbui_libmin='static/plugin_dbui/dbui-debug.js'
#-------------------------------------------------------------------------------
#
# LANGUAGE
#
#-------------------------------------------------------------------------------
T.set_current_languages('en', 'en-gb', 'en-us') # mother tongue
T.force('fr-fr') # user language
T.lazy = False # immediate translation
T.set_current_languages('en', 'en-gb', 'en-us') # mother tongue
T.force('fr-fr') # user language
T.lazy = False # immediate translation
locale.setlocale(locale.LC_ALL, "fr_FR.UTF-8")
......
""" plugin_dbui
Initialize the plugin_dbui
Define persistent storage, main services
Define persistent storage, main services
and methods available on the client side.
"""
import plugin_dbui as dbui
......@@ -12,7 +12,7 @@ from gluon.storage import Storage
from gluon.tools import PluginManager
# NOTE:
# define default configuration parameters for the plugin,
# define default configuration parameters for the plugin,
# the application using it and the persistent storage used to tune the widgets.
# In most of the case configuration parameters are either a relative path
# to a file (static/myapp.css) or to a directory (static/css) except app_script
......@@ -27,17 +27,18 @@ from gluon.tools import PluginManager
lg = dbui.get_language()
plugins = PluginManager('dbui',
app_css=None, # relative path static/myapp.css or dir or list
app_debug=None, # relative path static/src/my.js or dir or list
app_lg=None, # relative path or dir or list
app_libmin=None, # relative path static/myapp-min.js or dir
app_script=None, # relative path static/myapp.js
app_script_dir=None, # relative directory static/scripts
app_css=None, # relative path static/myapp.css or dir or list
app_debug=None, # relative path static/src/my.js or dir or list
app_git=None,
app_lg=None, # relative path or dir or list
app_libmin=None, # relative path static/myapp-min.js or dir
app_script=None, # relative path static/myapp.js
app_script_dir=None, # relative directory static/scripts
dbui_conf=URL(c='plugin_dbui', f='dbui_conf'),
dbui_conf_debug=URL(c='plugin_dbui',
f='dbui_conf',
dbui_conf_debug=URL(c='plugin_dbui',
f='dbui_conf',
vars=dict(debug="")),
dbui_css=['static/plugin_dbui/resources/css/kde-oxygen.css',
'static/plugin_dbui/resources/css/dbui.css'],
......@@ -45,10 +46,10 @@ plugins = PluginManager('dbui',
dbui_lg='static/plugin_dbui/locale/dbui-lang-%s.js' % lg,
dbui_libmin='static/plugin_dbui/dbui-min.js',
dbui_script='static/plugin_dbui/main.js',
ace_libmin='static/plugin_ace/src-min-noconflict/ace.js',
ace_css='static/plugin_ace/css/editor.css',
extjs_css='static/plugin_extjs/resources/css/ext-all.css',
extjs_debug='static/plugin_extjs/ext-dev.js',
extjs_libmin='static/plugin_extjs/ext-all.js',
......@@ -61,9 +62,9 @@ plugins = PluginManager('dbui',
modifier_grids={},
modifier_stores={},
modifier_viewports=Storage(extjs={}),
static_stores={})
# Start common services
dbSvc = dbui.DbSvc()
......@@ -80,29 +81,29 @@ def close_user_session():
return dbui.close_user_session()
@directSvc.register
def getForm(tablename):
def getForm(tablename):
return dbui.to_formPanel(db[tablename])
@directSvc.register
def getGrid(tablename):
def getGrid(tablename):
return dbui.to_gridPanel(db[tablename])
@directSvc.register
def create(data):
def create(data):
return dbSvc.create(data)
@directSvc.register
def count(data):
def count(data):
return dbSvc.count(data)
@directSvc.register
def destroy(data):
def destroy(data):
return dbSvc.destroy(data)
@directSvc.register
def read(data):
def read(data):
return dbSvc.read(data)
@directSvc.register
def update(data):
return dbSvc.update(data)
\ No newline at end of file
def update(data):
return dbSvc.update(data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment