Commit 2072abf1 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Customize grids by adding filter.

parent e590b2ed
# coding: utf8
{
'%Y-%m-%d': '%Y-%m-%d',
'Birth Date': 'Birth Date',
'Category': 'Category',
'Birth Date': 'Né le',
'Category': 'Catégorie',
'Code': 'Code',
'Collections': 'Collections',
'Controller': 'Controller',
'Cost': 'Cost',
'Definition': 'Definition',
'Demanded': 'Demanded',
'End Date': 'End Date',
'Executed': 'Executed',
'First Name': 'First Name',
'Forms': 'Forms',
'Cost': 'Coût',
'Definition': 'Définition',
'Demanded': 'Demandé',
'End Date': 'Date de fin',
'Executed': 'Executé',
'Filter budgets': 'Filter budgets',
'Filter careers': 'Filter careers',
'Filter hardware': 'Filter hardware',
'Filter people': 'Filter people',
'Filter responsabilities': 'Filter responsabilities',
'First Name': 'Nom de famille',
'Forms': 'Formulaire',
'Grade': 'Grade',
'Hdr': 'Hdr',
'Hdr Date': 'Hdr Date',
'Hdr defense date': "Date de soutenace de l'hdr",
'Host': 'Host',
'Id': 'Id',
'Initials': 'Initials',
'Last Name': 'Last Name',
'Level': 'Level',
'Line': 'Line',
'Initials': 'Initiales',
'Last Name': 'Prénom',
'Level': 'Niveau',
'Line': 'Ligne',
'Max Records': 'Max Records',
'Model': 'Model',
'Name': 'Name',
'Model': 'Modèle',
'Name': 'Nom',
'Note': 'Note',
'Notified': 'Notified',
'Organization': 'Organization',
'Percentage': 'Percentage',
'Person': 'Person',
'Notified': 'Notifié',
'Organization': 'Organisation',
'Percentage': 'Pourcentage',
'Period': 'Periode',
'Person': 'Persone',
'PhD': 'PhD',
'Phd': 'Phd',
'Phd Date': 'Phd Date',
'Project': 'Project',
'Phd defense date': 'Date de la soutenance de la thèse',
'Project': 'Projet',
'Ratio': 'Ratio',
'Select': 'Select',
'Start Date': 'Start Date',
'Select': 'Selectionnez',
'Start Date': 'Date de début',
'Store': 'Store',
'Tables': 'Tables',
'Team': 'Team',
'Tools': 'Tools',
'Year': 'Year',
'Team': 'Équipe',
'Tools': 'Outils',
'Year': 'Année',
'Year End': 'Year End',
'Year Start': 'Year Start',
'budgets': 'budgets',
'careers': 'careers',
'categories': 'categories',
'careers': 'carrières',
'categories': 'catégories',
'enter a number between %(min)g and %(max)g': 'enter a number between %(min)g and %(max)g',
'enter an integer between %(min)g and %(max)g': 'enter an integer between %(min)g and %(max)g',
'hardware': 'hardware',
'harvesters': 'harvesters',
'levels': 'levels',
'organizations': 'organizations',
'people': 'people',
'projects': 'projects',
'responsabilities': 'responsabilities',
'teams': 'teams',
'undefined': 'undefined',
'levels': 'niveaux',
'organizations': 'organisations',
'people': 'personnel',
'projects': 'projets',
'responsabilities': 'responsabilités',
'select entries for the category': 'select entries for the category',
'select entries for the level': 'select entries for the level',
'select entries for the organization': 'select entries for the organization',
'select entries for the person': 'select entries for the person',
'select entries for the project': 'select entries for the project',
'select entries for the team': 'select entries for the team',
'select entries for the year': 'select entries for the year',
'select entries where family name contains': 'select entries where family name contains',
'select entries where first name contains': 'select entries where first name contains',
'select entries where initials contains': 'select entries where initials contains',
'select entries where line contains': 'select entries where line contains',
'select people for the category': 'select people for the category',
'select people for the project': 'select people for the project',
'select people for the team': 'select people for the team',
'select people with a first name containing': 'select people with a first name containing',
'teams': 'équipes',
'undefined': 'undéfini',
}
......@@ -73,8 +73,8 @@ db.define_table("people",
Field("birth_date", "date"),
Field("phd", "boolean", default=False),
Field("hdr", "boolean", default=False),
Field("phd_date", "date"),
Field("hdr_date", "date"),
Field("phd_date", "date", comment=T("Phd defense date")),
Field("hdr_date", "date", comment=T("Hdr defense date")),
migrate="people.table")
db.define_table("organizations",
......
......@@ -14,11 +14,101 @@ dbui.configure_grids(db, plugins=['pGridRowEditorConfirmDelete',
dbui.configure_forms(db, plugins=['pFormToolTip'])
#
# The form node of the navigation tree
# merge date fields in the careers/hardware/responsabilites forms
#
formNode = dbui.Node(T('Forms'))
configurator = lambda tablename: dbui.to_formPanel(db[tablename])
formNode.add_children(db.tables, func=configurator)
for table in ('careers', 'hardware', 'responsabilities'):
fieldsModifier = dbui.FieldsModifier(table)
fieldsModifier.configure_field('start_date', flex=1)
fieldsModifier.configure_field('end_date', flex=1)
fieldsModifier.merge_fields('start_date', 'end_date', fieldLabel=T('Period'))
#
# merge phd and fields
#
fieldsModifier = dbui.FieldsModifier('people')
fieldsModifier.configure_field('phd', flex=0.1)
fieldsModifier.configure_field('phd_date', flex=1)
fieldsModifier.merge_fields('phd', 'phd_date', fieldLabel=T('Phd'))
fieldsModifier.configure_field('hdr', flex=0.1)
fieldsModifier.configure_field('hdr_date', flex=1)
fieldsModifier.merge_fields('hdr', 'hdr_date', fieldLabel=T('Hdr'))
#
# customized grid budgets
#
gridModifier = dbui.GridModifier('budgets')
gridModifier.set_rownumbering()
filters = [('year', '==', T('select entries for the year')),
('id_people', '==', T('select entries for the person')),
('id_teams', '==', T('select entries for the team')),
('id_projects', '==', T('select entries for the project')),
('line', 'contains', T('select entries where line contains'))]
gridModifier.set_filters(*filters,
plugins=['pFormToolTip'],
width=300)
#
# customized grid careers
#
gridModifier = dbui.GridModifier('careers')
gridModifier.set_rownumbering()
filters = [('id_people', '==', T('select entries for the person')),
('id_teams', '==', T('select entries for the team')),
('id_projects', '==', T('select entries for the project')),
('id_categories', '==', T('select entries for the category'))]
gridModifier.set_filters(*filters,
plugins=['pFormToolTip'],
width=300)
#
# customized grid hardware
#
gridModifier = dbui.GridModifier('hardware')
gridModifier.set_rownumbering()
filters = [('id_people', '==', T('select entries for the person')),
('id_teams', '==', T('select entries for the team')),
('id_projects', '==', T('select entries for the project'))]
gridModifier.set_filters(*filters,
plugins=['pFormToolTip'],
width=300)
#
# customized grid people
#
gridModifier = dbui.GridModifier('people')
gridModifier.set_rownumbering()
#filters = [('first_name', 'contains', T('select entries where first name contains')),
#('last_name', 'contains', T('select entries where family name contains')),
#('initials', 'contains', T('select entries where initials contains'))]
#gridModifier.set_filters(*filters,
#plugins=['pFormToolTip'],
#width=300)
#
# customized grid responsabilities
#
gridModifier = dbui.GridModifier('responsabilities')
gridModifier.set_rownumbering()
filters = [('id_people', '==', T('select entries for the person')),
('id_teams', '==', T('select entries for the team')),
('id_projects', '==', T('select entries for the project')),
('id_organizations', '==', T('select entries for the organization')),
('id_levels', '==', T('select entries for the level'))]
gridModifier.set_filters(*filters,
plugins=['pFormToolTip'],
width=300)
#
# The grid node of the navigation tree
......@@ -31,10 +121,10 @@ gridNode.add_children(db.tables, func=configurator)
# The tool node of the navigation tree
#
toolNode = dbui.Node(T('Tools'))
#toolNode.sort_children()
toolNode.sort_children()
#
# The viewport with its navigation tree
#
viewportModifier = dbui.ViewportModifier()
viewportModifier.add_node(formNode, gridNode, toolNode)
viewportModifier.add_node(gridNode, toolNode)
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