Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
w2pext
plugin_dbui
Commits
f5124393
Commit
f5124393
authored
14 years ago
by
Renaud Le Gac
Browse files
Options
Downloads
Patches
Plain Diff
the method get_tables is now public.
parent
4cdaa3ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/plugin_dbui/cfgsvc.py
+24
-24
24 additions, 24 deletions
modules/plugin_dbui/cfgsvc.py
with
24 additions
and
24 deletions
modules/plugin_dbui/cfgsvc.py
+
24
−
24
View file @
f5124393
...
@@ -427,26 +427,6 @@ class CfgSvc(BaseSvc):
...
@@ -427,26 +427,6 @@ class CfgSvc(BaseSvc):
return
di
return
di
def
_get_tables
(
self
):
"""
Return a dictionary with list of tables
and a list with the translation of their names
The method take into accounts hidden tables defined
by the viewport modifiers
"""
T
=
self
.
environment
[
'
T
'
]
db
=
self
.
environment
[
'
db
'
]
viewport_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
viewport_modifiers
hidden_tables
=
viewport_modifiers
.
hidden_tables
li_1
=
[
el
for
el
in
db
.
tables
if
el
not
in
hidden_tables
]
li_1
.
sort
()
li_2
=
[
str
(
T
(
el
))
for
el
in
li_1
]
return
{
'
tables
'
:
li_1
,
'
tablesText
'
:
li_2
}
def
_is_foreign_field
(
self
,
tablename
,
fieldname
):
def
_is_foreign_field
(
self
,
tablename
,
fieldname
):
"""
Wrapper method
"""
Wrapper method
...
@@ -471,7 +451,7 @@ class CfgSvc(BaseSvc):
...
@@ -471,7 +451,7 @@ class CfgSvc(BaseSvc):
T
=
self
.
environment
[
'
T
'
]
T
=
self
.
environment
[
'
T
'
]
cfg
=
{
'
items
'
:
self
.
_get_form_items
(
tablename
),
cfg
=
{
'
items
'
:
self
.
_get_form_items
(
tablename
),
'
store
'
:
self
.
get_jsonstore
(
tablename
)
,
'
store
'
:
STOREID
%
tablename
,
'
xtype
'
:
'
xform
'
}
'
xtype
'
:
'
xform
'
}
form_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
form_modifiers
form_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
form_modifiers
...
@@ -496,7 +476,7 @@ class CfgSvc(BaseSvc):
...
@@ -496,7 +476,7 @@ class CfgSvc(BaseSvc):
# where: define inner join, mainly to resolve foreign key
# where: define inner join, mainly to resolve foreign key
base_params
=
{
'
tableName
'
:
tablename
,
'
dbFields
'
:
[]}
base_params
=
{
'
tableName
'
:
tablename
,
'
dbFields
'
:
[]}
cfg
=
{
'
autoLoad
'
:
Tru
e
,
cfg
=
{
'
autoLoad
'
:
Fals
e
,
'
autoSave
'
:
True
,
'
autoSave
'
:
True
,
'
baseParams
'
:
base_params
,
'
baseParams
'
:
base_params
,
'
fields
'
:
[],
'
fields
'
:
[],
...
@@ -560,7 +540,7 @@ class CfgSvc(BaseSvc):
...
@@ -560,7 +540,7 @@ class CfgSvc(BaseSvc):
cfg
=
{
'
columns
'
:
self
.
_get_columns_model
(
tablename
),
cfg
=
{
'
columns
'
:
self
.
_get_columns_model
(
tablename
),
'
frame
'
:
False
,
'
frame
'
:
False
,
'
store
'
:
self
.
get_jsonstore
(
tablename
)
,
'
store
'
:
STOREID
%
tablename
,
'
viewConfig
'
:
{
'
forceFit
'
:
True
},
'
viewConfig
'
:
{
'
forceFit
'
:
True
},
'
xtype
'
:
'
xgrid
'
}
'
xtype
'
:
'
xgrid
'
}
...
@@ -576,6 +556,26 @@ class CfgSvc(BaseSvc):
...
@@ -576,6 +556,26 @@ class CfgSvc(BaseSvc):
return
cfg
return
cfg
def
get_tables
(
self
):
"""
Return a dictionary with list of tables
and a list with the translation of their names
The method take into accounts hidden tables defined
by the viewport modifiers
"""
T
=
self
.
environment
[
'
T
'
]
db
=
self
.
environment
[
'
db
'
]
viewport_modifiers
=
self
.
environment
[
'
plugins
'
].
dbui
.
viewport_modifiers
hidden_tables
=
viewport_modifiers
.
hidden_tables
li_1
=
[
el
for
el
in
db
.
tables
if
el
not
in
hidden_tables
]
li_1
.
sort
()
li_2
=
[
str
(
T
(
el
))
for
el
in
li_1
]
return
{
'
tables
'
:
li_1
,
'
tablesText
'
:
li_2
}
def
get_viewport
(
self
):
def
get_viewport
(
self
):
"""
Build the the configuration options of the Ext.Viewport
"""
Build the the configuration options of the Ext.Viewport
the main widget of the user interface.
the main widget of the user interface.
...
@@ -591,7 +591,7 @@ class CfgSvc(BaseSvc):
...
@@ -591,7 +591,7 @@ class CfgSvc(BaseSvc):
append_plugin of the ViewportModifier.
append_plugin of the ViewportModifier.
"""
"""
di
=
self
.
_
get_tables
()
di
=
self
.
get_tables
()
plugins
=
[]
plugins
=
[]
# configure the plugin to handle entryForm
# configure the plugin to handle entryForm
...
...
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