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
tev
plugin_event
Commits
204e76f5
Commit
204e76f5
authored
Feb 19, 2015
by
LE GAC Renaud
Browse files
Add linked comboBox in the graphs form.
parent
8710d10a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
languages/fr-fr.py
languages/fr-fr.py
+2
-4
models/db0_graphs.py
models/db0_graphs.py
+1
-3
models/ui_graphs.py
models/ui_graphs.py
+25
-0
No files found.
languages/fr-fr.py
View file @
204e76f5
...
...
@@ -280,11 +280,9 @@
'Registration identifier'
:
'Registration identifier'
,
'Registration key'
:
'Registration key'
,
'Registration successful'
:
'Registration successful'
,
'Report Name'
:
'
Report Name
'
,
'Report Type'
:
'R
e
port
Type
'
,
'Report Name'
:
'
Nom du rapport
'
,
'Report Type'
:
'R
ap
port'
,
'Reports'
:
'Rapports'
,
'Reports (new)'
:
'Rapports (new)'
,
'Reports (old)'
:
'Rapports (old)'
,
'Reset Password key'
:
'Reset Password key'
,
'responsibilities'
:
'responsabilités'
,
'Responsibility'
:
'Responsabilité'
,
...
...
models/db0_graphs.py
View file @
204e76f5
...
...
@@ -15,10 +15,8 @@ if MIGRATE:
db
.
define_table
(
"graphs"
,
Field
(
"name"
,
"string"
,
length
=
255
,
notnull
=
True
,
unique
=
True
),
Field
(
"title"
,
"string"
,
length
=
255
),
Field
(
"report_type"
,
"string"
,
default
=
'lists'
,
length
=
255
,
notnull
=
True
),
Field
(
"report_type"
,
"string"
,
length
=
255
,
notnull
=
True
),
Field
(
"report_name"
,
"string"
,
length
=
255
,
notnull
=
True
),
Field
(
"plot"
,
"text"
,
notnull
=
True
,
default
=
def_plot
),
Field
(
"definition"
,
"text"
),
migrate
=
"graphs.table"
)
db
.
graphs
.
report_type
.
requires
=
IS_IN_SET
((
'lists'
,
'metrics1d'
,
'metrics2d'
))
\ No newline at end of file
models/ui_graphs.py
View file @
204e76f5
...
...
@@ -16,6 +16,31 @@ fieldsModifier.configure_field('plot',
height
=
240
,
hideLabel
=
True
)
# the field report type and name are linked ComboBox
store
=
dbui
.
Store
(
data
=
[],
fields
=
[])
store
.
fields
.
append
(
dict
(
name
=
"report_type"
,
type
=
"string"
))
store
.
fields
.
append
(
dict
(
name
=
"report_name"
,
type
=
"string"
))
for
tablename
in
(
'lists'
,
'metrics1d'
,
'metrics2d'
):
for
row
in
db
().
select
(
db
[
tablename
].
name
):
store
.
data
.
append
(
dict
(
report_type
=
tablename
,
report_name
=
row
.
name
))
fieldsModifier
.
configure_field
(
'report_type'
,
displayField
=
'report_type'
,
emptyText
=
T
(
'select...'
),
itemId
=
'mastercombo_report_type'
,
refStore
=
store
,
valueField
=
'report_type'
,
xtype
=
'xcomboboxmaster'
)
fieldsModifier
.
configure_field
(
'report_name'
,
displayField
=
'report_name'
,
emptyText
=
T
(
'select...'
),
masterItemId
=
'mastercombo_report_type'
,
masterValueField
=
'report_type'
,
refStore
=
store
,
valueField
=
'report_name'
,
xtype
=
'xcomboboxslave'
)
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
...
...
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