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
bd46d9c8
Commit
bd46d9c8
authored
Nov 09, 2016
by
LE GAC Renaud
Browse files
Update to_panelWithUrlSelector to avoid fixed options.
parent
36c39a45
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
modules/plugin_dbui/converter.py
modules/plugin_dbui/converter.py
+14
-7
No files found.
modules/plugin_dbui/converter.py
View file @
bd46d9c8
...
...
@@ -859,13 +859,20 @@ def to_model(table):
return
cfg
def
to_panelWithUrlSelector
(
table
,
selectorTitle
=
'Select'
,
**
kwargs
):
def
to_panelWithUrlSelector
(
table
,
selectorLayout
=
dict
(
align
=
'stretch'
,
type
=
'vbox'
,
vertical
=
True
),
selectorPlugins
=
[
'pFormToolTip'
],
selectorTitle
=
'Select'
,
**
kwargs
):
"""Build the configuration of the :class:`.PanelWithUrlSelector` widget.
Args:
table (gluon.dal.Table): database table. It is used to build the form
to select values. The form has one entry per table field.
selectorLayout (dict): the layout for the field, by default vbox.
selectorPlugins (list): list of plugins to be used by the selector.
selectorTitle (str):
the title of the FieldSet encapsulating
the selector fields.
...
...
@@ -889,16 +896,16 @@ def to_panelWithUrlSelector(table, selectorTitle='Select', **kwargs):
if
'baseUrl'
not
in
kwargs
:
raise
BaseException
(
'The keyword argument basseUrl is missing.'
)
# build the
selector from
the table
# build the
list of fields
the table
fields
=
to_fields
(
table
)
# configure the selector
selector
=
FieldSet
(
items
=
fields
,
layout
=
{
'align'
:
'stretch'
,
'type'
:
'vbox'
,
'vertical'
:
True
},
plugins
=
[
'pFormToolTip'
],
layout
=
selectorLayout
,
plugins
=
selectorPlugins
,
title
=
current
.
T
(
selectorTitle
))
#
build the configuration for
the PanelWithUrlSelector
#
configure
the PanelWithUrlSelector
default
=
dict
(
selectorItems
=
selector
)
default
.
update
(
kwargs
)
...
...
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