Commit 204e76f5 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add linked comboBox in the graphs form.

parent 8710d10a
......@@ -280,11 +280,9 @@
'Registration identifier': 'Registration identifier',
'Registration key': 'Registration key',
'Registration successful': 'Registration successful',
'Report Name': 'Report Name',
'Report Type': 'Report Type',
'Report Name': 'Nom du rapport',
'Report Type': 'Rapport',
'Reports': 'Rapports',
'Reports (new)': 'Rapports (new)',
'Reports (old)': 'Rapports (old)',
'Reset Password key': 'Reset Password key',
'responsibilities': 'responsabilités',
'Responsibility': 'Responsabilité',
......
......@@ -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
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment