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
Open sidebar
w2pext
plugin_dbui
Commits
9e076ac9
Commit
9e076ac9
authored
Dec 22, 2011
by
Renaud Le Gac
Browse files
Rename configurator cfg_blabla into to_blabla.
parent
8ccf2051
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
models/widgets.py
models/widgets.py
+4
-4
modules/plugin_dbui/__init__.py
modules/plugin_dbui/__init__.py
+1
-1
modules/plugin_dbui/navtree.py
modules/plugin_dbui/navtree.py
+7
-10
No files found.
models/widgets.py
View file @
9e076ac9
...
...
@@ -181,17 +181,17 @@ gridModifier.set_filters(*filters,
#
formNode
=
dbui
.
Node
(
T
(
'Forms'
),
db
.
tables
,
lambda
tablename
:
cvtSvc
.
to_form_panel
(
db
[
tablename
]))
configurator
=
lambda
tablename
:
cvtSvc
.
to_form_panel
(
db
[
tablename
]))
gridNode
=
dbui
.
Node
(
T
(
'Tables'
),
db
.
tables
,
lambda
tablename
:
cvtSvc
.
to_grid_panel
(
db
[
tablename
]))
configurator
=
lambda
tablename
:
cvtSvc
.
to_grid_panel
(
db
[
tablename
]))
reportNode
=
dbui
.
Node
(
T
(
'Reports'
),
{
'report_1'
:
URL
(
c
=
"reports"
,
f
=
"report_1"
),
'report_2'
:
(
URL
(
c
=
"reports"
,
f
=
"report_2"
),
cvtSvc
.
to_form_items
(
dummy
.
foo1
))},
dbui
.
cfg
_url
_p
anel
,
configurators
=
{
'report_2'
:
dbui
.
cfg_configurable_url_panel
})
configurators
=
{
'report_1'
:
dbui
.
to
_url
P
anel
,
'report_2'
:
dbui
.
to_panelWithUrlSelector
})
viewportModifier
=
dbui
.
ViewportModifier
()
viewportModifier
.
add_node
(
formNode
,
gridNode
,
reportNode
)
modules/plugin_dbui/__init__.py
View file @
9e076ac9
...
...
@@ -23,5 +23,5 @@ from helper import (get_field_validators,
is_table_with_foreign_fields
)
from
mapper
import
map_default
,
map_tabpanel
from
modifier
import
Spacer
,
Widget
from
navtree
import
Node
,
cfg_configurable_url_panel
,
cfg
_url
_p
anel
from
navtree
import
Node
,
to_panelWithUrlSelector
,
to
_url
P
anel
from
viewportmodifier
import
ViewportModifier
\ No newline at end of file
modules/plugin_dbui/navtree.py
View file @
9e076ac9
...
...
@@ -9,14 +9,11 @@ from gluon import current
from
helper
import
is_mathjax
def
cfg_configurable_url_panel
(
key
,
value
):
""" Return the configuration dictionary for a panel displaying
an URL. The argument of the URL can be change using a form
appearing on the right side. The form is defined by a table
of the dummy database.
The ExtJS widget behind the scene is App.panel.PanelWithConfigurator.
def
to_panelWithUrlSelector
(
key
,
value
):
"""Return the configuration dictionary for a App.PanelWithUrlSelector.
the main panel displays the URL content while the selector panel shows
a form allowing to change the URL argument.
key
it the name of the leaf
...
...
@@ -50,7 +47,7 @@ def cfg_configurable_url_panel(key, value):
return
cfg
def
cfg
_url
_p
anel
(
key
,
url
):
def
to
_url
P
anel
(
key
,
url
):
"""Return the configuration dictionary for an Ext.Panel
displaying an URL.
...
...
@@ -85,7 +82,7 @@ class Node(object):
Dedicated configurator can be setup for each node if needed.
"""
def
__init__
(
self
,
text
,
leaves
,
configurator
,
configurators
=
{},
hidden
=
[]):
def
__init__
(
self
,
text
,
leaves
,
configurator
=
None
,
configurators
=
{},
hidden
=
[]):
"""Constructor of the node
text
...
...
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