Commit cffcae6b authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'feature_object_tables' into develop

parents f540b4d2 f37e4c4f
docs/db_schema/database.png

95.7 KB | W: | H:

docs/db_schema/database.png

130 KB | W: | H:

docs/db_schema/database.png
docs/db_schema/database.png
docs/db_schema/database.png
docs/db_schema/database.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -22,4 +22,4 @@
<type label="Upload" length="0" sql="upload" quote="'"/>
<type label="Password" length="0" sql="password" quote="'"/>
</group>
</datatypes><table x="303" y="21" name="people"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="first_name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="last_name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="initials" null="0" autoincrement="0"><datatype>string</datatype></row><row name="birth_date" null="1" autoincrement="0"><datatype>date</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="302" y="174" name="teams"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="team" null="0" autoincrement="0"><datatype>string</datatype></row><row name="domain" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="303" y="285" name="projects"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="project" null="0" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="618" y="19" name="people_categories"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="code" null="0" autoincrement="0"><datatype>string</datatype></row><row name="category" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="452" y="71" name="history"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="id_people" null="0" autoincrement="0"><datatype>integer</datatype><relation table="people" row="id" /></row><row name="id_teams" null="0" autoincrement="0"><datatype>integer</datatype><relation table="teams" row="id" /></row><row name="id_projects" null="0" autoincrement="0"><datatype>integer</datatype><relation table="projects" row="id" /></row><row name="id_people_categories" null="0" autoincrement="0"><datatype>integer</datatype><relation table="people_categories" row="id" /></row><row name="id_fundings" null="0" autoincrement="0"><datatype>integer</datatype><relation table="fundings" row="id" /></row><row name="id_events" null="0" autoincrement="0"><datatype>integer</datatype><relation table="events" row="id" /></row><row name="start_date" null="0" autoincrement="0"><datatype>date</datatype></row><row name="end_date" null="1" autoincrement="0"><datatype>date</datatype></row><row name="percentage" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="0" autoincrement="0"><datatype>text</datatype></row><row name="data" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="633" y="149" name="fundings"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="agency" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="638" y="266" name="events"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="event" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definitiion" null="1" autoincrement="0"><datatype>text</datatype></row><row name="data" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="806" y="19" name="lists"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="conditions" null="1" autoincrement="0"><datatype>text</datatype></row><row name="group_field" null="1" autoincrement="0"><datatype>string</datatype></row><row name="sorters" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="columns" null="0" autoincrement="0"><datatype>text</datatype></row><row name="features" null="1" autoincrement="0"><datatype>text</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="903" y="18" name="metrics2d"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="conditions" null="1" autoincrement="0"><datatype>text</datatype></row><row name="group_field_x" null="0" autoincrement="0"><datatype>string</datatype></row><row name="group_field_y" null="0" autoincrement="0"><datatype>string</datatype></row><row name="metric_field_z" null="0" autoincrement="0"><datatype>string</datatype></row><row name="aggregate_z" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="909" y="224" name="graphs"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="report_type" null="0" autoincrement="0"><datatype>string</datatype></row><row name="report_name" null="1" autoincrement="0"><datatype>string</datatype></row><row name="plot" null="0" autoincrement="0"><datatype>text</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="777" y="225" name="metrics1d"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="conditions" null="1" autoincrement="0"><datatype>text</datatype></row><row name="group_field" null="1" autoincrement="0"><datatype>string</datatype></row><row name="columns" null="0" autoincrement="0"><datatype>text</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>
\ No newline at end of file
</datatypes><table x="303" y="21" name="people"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="first_name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="last_name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="initials" null="0" autoincrement="0"><datatype>string</datatype></row><row name="birth_date" null="1" autoincrement="0"><datatype>date</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="302" y="174" name="teams"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="team" null="0" autoincrement="0"><datatype>string</datatype></row><row name="domain" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="303" y="285" name="projects"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="project" null="0" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="618" y="19" name="people_categories"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="code" null="0" autoincrement="0"><datatype>string</datatype></row><row name="category" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="452" y="71" name="history"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="id_people" null="0" autoincrement="0"><datatype>integer</datatype><relation table="people" row="id" /></row><row name="id_teams" null="0" autoincrement="0"><datatype>integer</datatype><relation table="teams" row="id" /></row><row name="id_projects" null="0" autoincrement="0"><datatype>integer</datatype><relation table="projects" row="id" /></row><row name="id_people_categories" null="0" autoincrement="0"><datatype>integer</datatype><relation table="people_categories" row="id" /></row><row name="id_fundings" null="0" autoincrement="0"><datatype>integer</datatype><relation table="fundings" row="id" /></row><row name="id_objects" null="0" autoincrement="0"><datatype>integer</datatype><relation table="objects" row="id" /></row><row name="id_object_categories" null="0" autoincrement="0"><datatype>integer</datatype><relation table="object_categories" row="id" /></row><row name="id_events" null="0" autoincrement="0"><datatype>integer</datatype><relation table="events" row="id" /></row><row name="start_date" null="0" autoincrement="0"><datatype>date</datatype></row><row name="end_date" null="1" autoincrement="0"><datatype>date</datatype></row><row name="percentage" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="0" autoincrement="0"><datatype>text</datatype></row><row name="data" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="633" y="149" name="fundings"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="agency" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="638" y="266" name="events"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="event" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definitiion" null="1" autoincrement="0"><datatype>text</datatype></row><row name="data" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="827" y="22" name="lists"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="conditions" null="1" autoincrement="0"><datatype>text</datatype></row><row name="group_field" null="1" autoincrement="0"><datatype>string</datatype></row><row name="sorters" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="columns" null="0" autoincrement="0"><datatype>text</datatype></row><row name="features" null="1" autoincrement="0"><datatype>text</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="934" y="193" name="metrics2d"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="conditions" null="1" autoincrement="0"><datatype>text</datatype></row><row name="group_field_x" null="0" autoincrement="0"><datatype>string</datatype></row><row name="group_field_y" null="0" autoincrement="0"><datatype>string</datatype></row><row name="metric_field_z" null="0" autoincrement="0"><datatype>string</datatype></row><row name="aggregate_z" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="1065" y="22" name="graphs"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="report_type" null="0" autoincrement="0"><datatype>string</datatype></row><row name="report_name" null="1" autoincrement="0"><datatype>string</datatype></row><row name="plot" null="0" autoincrement="0"><datatype>text</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="929" y="19" name="metrics1d"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="name" null="0" autoincrement="0"><datatype>string</datatype></row><row name="title" null="1" autoincrement="0"><datatype>string</datatype></row><row name="conditions" null="1" autoincrement="0"><datatype>text</datatype></row><row name="group_field" null="1" autoincrement="0"><datatype>string</datatype></row><row name="columns" null="0" autoincrement="0"><datatype>text</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="616" y="391" name="object_categories"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="code" null="0" autoincrement="0"><datatype>string</datatype></row><row name="category" null="0" autoincrement="0"><datatype>string</datatype></row><row name="definition" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="324" y="372" name="objects"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="reference" null="1" autoincrement="0"><datatype>string</datatype></row><row name="serial_number" null="0" autoincrement="0"><datatype>string</datatype></row><row name="batch_number" null="0" autoincrement="0"><datatype>string</datatype></row><row name="note" null="0" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table></sql>
\ No newline at end of file
......@@ -30,6 +30,7 @@
'auth_membership': 'auth_membership',
'auth_permission': 'auth_permission',
'auth_user': 'auth_user',
'Batch Number': 'Lot',
'Binary files': 'Fichiers binaires',
'Birth Date': 'Né le',
'budgets': 'budgets',
......@@ -38,6 +39,8 @@
'Cannot be empty': 'Cannot be empty',
'careers': 'carrières',
'CAS': 'CAS',
'Cat. objet': 'Cat. objet',
'Cat. personne': 'Cat. personne',
'categories': 'catégories',
'Category': 'Catégorie',
'Catégorie': 'Catégorie',
......@@ -47,6 +50,7 @@
'Check to delete': 'Check to delete',
'Client IP': 'Client IP',
'Code': 'Code',
'Code objet': 'Code objet',
'Collections': 'Collections',
'Columns': 'Colonnes',
'Conditions': 'Conditions',
......@@ -122,11 +126,13 @@
'Filter hardware': 'Filtrer le matérielle',
'Filter history': "Filtrer l'historique",
'Filter levels': 'Filtrer les niveaus',
'Filter objects': 'Filtrer les objects',
'Filter organizations': 'Filtrer les organisations',
'Filter people': 'Filtrer les persones',
'Filter projects': 'Filtrer les projets',
'Filter responsibilities': 'Filter les responsabilities',
'Filter teams': 'Filtrer les équipes',
'Financement': 'Financement',
'First name': 'First name',
'First Name': 'Prénom',
'For developpers': 'Pour les développeurs',
......@@ -242,7 +248,12 @@
'Nom de famille': 'Nom de famille',
'Note': 'Note',
'Notified': 'Notifié',
'Object': 'Objet',
'Object category': 'Cat. objet',
'Object code': 'Code objet',
'Object or table name': 'Object or table name',
'object_categories': "catégories d'object",
'objects': 'objets',
'Open source': 'Code open source',
'Order by': 'Trié par',
'Orderby': 'Trié par',
......@@ -251,9 +262,12 @@
"Password fields don't match": "Password fields don't match",
'People': 'Personnes',
'people': 'personnes',
'People and objects': 'Personne & objets',
'People category': 'Cat. personne',
'People per category': 'Personnes par catégorie',
'People per quality': 'Personnes par qualité',
'People per team': 'Personnes par équipe',
'People quality': 'Qualité personne',
'people_categories': 'catégories de personnel',
'Perc.': 'Perc.',
'Percentage': 'Pourcentage',
......@@ -282,8 +296,10 @@
'Python Code': 'Python Code',
'Quality': 'Qualité',
'Qualité': 'Qualité',
'Qualité personne': 'Qualité personne',
'Ratio': 'Ratio',
'Record ID': 'Record ID',
'Reference': 'Référence',
'Register': 'Register',
'Registration identifier': 'Registration identifier',
'Registration key': 'Registration key',
......@@ -301,6 +317,7 @@
'Select a teams and/or a project !!!': 'Select a teams and/or a project !!!',
'Select the history records. It can used any field of the history table using the SQL WHERE syntax, but the foreign keys are not resolved nor the individual property of the history.data dictionary. (more information in the smart_query in the web2py documentation).': "Selectionne l'historique. C'est une requête SQL WHERE bâtie à partir des champs des la table history, mais les clés étrangères ne sont pas résolues ni les clés du dictionnaire history.data dictionary. (voir les requêtes 'smart_query' dans la documentaion web2py).",
'select...': 'selectionner...',
'Serial Number': 'Numéro de Série',
'Sign Up': 'Sign Up',
'since %s': 'depuis %s',
'software': 'logiciels',
......
......@@ -62,6 +62,8 @@ tables = ['auth_group',
'lists',
'metrics1d',
'metrics2d',
'object_categories',
'objects',
'people',
'people_categories',
'projects',
......
# -*- coding: utf-8 -*-
""" object_categories
"""
db.define_table("object_categories",
Field("code", "string", length=255, notnull=True, unique=True),
Field("category", "string", length=255, notnull=True),
Field("definition", "text"),
migrate="object_categories.table")
db.object_categories._before_delete.append(INHIBIT_CASCADE_DELETE)
db.object_categories._before_delete.append(dbui.INHIBIT_DELETE_UNDEF)
db.object_categories._before_update.append(dbui.INHIBIT_UPDATE_UNDEF)
# -*- coding: utf-8 -*-
""" objects
"""
db.define_table("objects",
Field("reference", "string", length=255, notnull=True, unique=True),
Field("serial_number", "string", length=255),
Field("batch_number", "string", length=255),
Field("note", "text"),
migrate="objects.table")
db.objects._before_delete.append(INHIBIT_CASCADE_DELETE)
db.objects._before_delete.append(dbui.INHIBIT_DELETE_UNDEF)
db.objects._before_update.append(dbui.INHIBIT_UPDATE_UNDEF)
......@@ -11,14 +11,3 @@ db.define_table("people_categories",
db.people_categories._before_delete.append(INHIBIT_CASCADE_DELETE)
db.people_categories._before_delete.append(dbui.INHIBIT_DELETE_UNDEF)
db.people_categories._before_update.append(dbui.INHIBIT_UPDATE_UNDEF)
#------------------------------------------------------------------------------
#
# LIST of people categories to be used in selector
#
#------------------------------------------------------------------------------
rows = db().select(db.people_categories.category,
orderby=db.people_categories.category,
distinct=True)
PEOPLE_CATEGORIES = [el.category for el in rows]
\ No newline at end of file
# -*- coding: utf-8 -*-
""" alias_object_categories
alias tables for object_categories
"""
db.object_categories.with_alias('alias_object_categories')
# -*- coding: utf-8 -*-
""" categories
""" alias_people_categories
alias tables for people_categories
"""
db.people_categories.with_alias('categories')
db.people_categories.with_alias('alias_people_categories')
......@@ -3,15 +3,17 @@
"""
db.define_table("history",
Field("id_people", "reference people", default=undef_id, label='Person'),
Field("id_events", "reference events", default=undef_id, label='Event'),
Field("id_teams", "reference teams", default=undef_id, label='Team'),
Field("id_projects", "reference projects", default=undef_id, label='Project'),
Field("id_people_categories", "reference people_categories", default=undef_id, label='Category'),
Field("id_fundings", "reference fundings", default=undef_id, label='Funding'),
Field("id_events", "reference events", default=undef_id, label='Event'),
Field("id_people", "reference people", default=undef_id, label='Person'),
Field("id_people_categories", "reference people_categories", default=undef_id, label='People category'),
Field("percentage", "integer", default=None),
Field("id_objects", "reference objects", default=undef_id, label='Object'),
Field("id_object_categories", "reference object_categories", default=undef_id, label='Object category'),
Field("start_date", "date", default=today, notnull=True),
Field("end_date", "date"),
Field("percentage", "integer", default=None, label='Perc.'),
Field("note", "text"),
Field("data", "json"),
migrate="history.table")
......
......@@ -28,20 +28,25 @@ fieldsModifier.configure_field('note', height=150)
#
#-------------------------------------------------------------------------------
formModifier = dbui.FormModifier('history')
formModifier.merge_fields('id_people',
'id_teams',
formModifier.merge_fields('id_teams',
'id_projects',
'id_people_categories',
'id_fundings',
'percentage',
title=T('Metadata'))
formModifier.merge_fields('start_date',
'id_events',
formModifier.merge_fields('id_people',
'id_people_categories',
'percentage',
title=T('Person'))
formModifier.merge_fields('id_objects',
'id_object_categories',
title=T('Object'))
formModifier.merge_fields('id_events',
'start_date',
'data',
title=T('Event'))
formModifier.merge_fields('note',
title=T('Note'))
......@@ -57,26 +62,20 @@ formModifier.configure(buttonAlign='right', width=450)
gridModifier = dbui.GridModifier('history')
gridModifier.configure(plugins=['pGridPaging'])
gridModifier.hide_columns('cdd_flag',
'data',
'id_organization_levels',
'id_organizations',
'id_projects',
'id_fundings',
'hardware_cost',
'hardware_model',
gridModifier.hide_columns('data',
'id_object_categories',
'id_people_categories',
'note',
'percentage',
'responsibility',
'trainee_category',
'trainee_title',
'trainee_university')
'percentage')
gridModifier.append_filter(('people.last_name', 'contains', T('contains')))
gridModifier.append_filter(('id_events', '==', T('is equal to')))
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
gridModifier.append_filter(('id_projects', '==', T('is equal to')))
gridModifier.append_filter(('id_fundings', '==', T('is equal to')))
gridModifier.append_filter(('people.last_name', 'contains', T('contains')))
gridModifier.append_filter(('id_people_categories', '==', T('is equal to')))
gridModifier.append_filter(('id_events', '==', T('is equal to')))
gridModifier.append_filter(('objects.reference', 'contains', T('contains')))
gridModifier.append_filter(('id_object_categories', '==', T('is equal to')))
gridModifier.append_filter(('start_date', '>=', T('greater or equal to')))
gridModifier.append_filter(('end_date', '<=', T('less or equal to')))
......
# -*- coding: utf-8 -*-
""" person_wizard
""" object_categories
"""
virtdb.define_table('person_wizard',
Field("first_name", "string"),
Field("last_name", "string"),
Field("initials", "string"),
Field("birth_date", "date"),
Field("start_date", "date"),
Field("end_date", "date"),
Field("id_people_categories", 'reference people_categories', default=undef_id, label=T('Category')),
Field("id_teams", 'reference teams', label=T('Team')),
Field("id_projects", 'reference projects', default=undef_id, label=T('Project')))
virtdb.person_wizard.id_people_categories.requires = \
IS_IN_DB(db, 'people_categories.code')
virtdb.person_wizard.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.person_wizard.id_teams.requires = IS_IN_DB(db, 'teams.team')
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
......@@ -30,3 +13,20 @@ virtdb.person_wizard.id_teams.requires = IS_IN_DB(db, 'teams.team')
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#
# GRID CONFIGURATiON
#
#-------------------------------------------------------------------------------
gridModifier = dbui.GridModifier('object_categories')
gridModifier.configure_column('code', width=20)
gridModifier.configure_column('category', width=20)
#-------------------------------------------------------------------------------
#
# STORE CONFIGURATiON
#
#-------------------------------------------------------------------------------
storeModifier = dbui.StoreModifier('object_categories')
storeModifier.orderby(db.object_categories.code)
# -*- coding: utf-8 -*-
""" objects
"""
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#
# GRID CONFIGURATiON
#
#-------------------------------------------------------------------------------
gridModifier = dbui.GridModifier('objects')
gridModifier.append_filter(('reference', 'contains', T('contains')))
gridModifier.append_filter(('serial_number', 'contains', T('contains')))
gridModifier.append_filter(('batch_number', 'contains', T('contains')))
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
#-------------------------------------------------------------------------------
#
# STORE CONFIGURATiON
#
#-------------------------------------------------------------------------------
storeModifier = dbui.StoreModifier('objects')
storeModifier.orderby(db.objects.reference)
......@@ -11,12 +11,27 @@ if not db(db.events.id).count():
definition=undef)
if not db(db.fundings.id).count():
db.fundings.insert(id=undef_id, agency=undef, definition=undef)
db.fundings.insert(id=undef_id,
agency=undef,
definition=undef)
if not db(db.object_categories.id).count():
db.object_categories.insert(id=undef_id,
code=undef,
category=undef,
definition=undef)
if not db(db.objects.id).count():
db.objects.insert(id=undef_id,
reference=undef,
serial_number=undef,
batch_number=undef)
if not db(db.people.id).count():
db.people.insert(id=undef_id, first_name=undef,
last_name=undef,
initials=undef)
db.people.insert(id=undef_id,
first_name=undef,
last_name=undef,
initials=undef)
if not db(db.people_categories.id).count():
db.people_categories.insert(id=undef_id,
......@@ -25,7 +40,10 @@ if not db(db.people_categories.id).count():
definition=undef)
if not db(db.projects.id).count():
db.projects.insert(id=undef_id, project=undef)
db.projects.insert(id=undef_id,
project=undef)
if not db(db.teams.id).count():
db.teams.insert(id=undef_id, team=undef, domain=undef)
\ No newline at end of file
db.teams.insert(id=undef_id,
team=undef,
domain=undef)
\ No newline at end of file
# -*- coding: utf-8 -*-
""" grid_selector
"""
virtdb.define_table('grid_selector',
Field('year_start', 'integer', default=year),
Field('year_end', 'integer'),
Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')),
Field('id_categories', 'reference categories', label= T("Category")),
Field('id_people_categories', 'reference people_categories', label= T("Quality")))
virtdb.grid_selector.id_categories.requires = \
IS_IN_DB(db, 'categories.category')
virtdb.grid_selector.id_people_categories.requires = \
IS_IN_DB(db, 'people_categories.code')
virtdb.grid_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.grid_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('grid_selector')
fieldsModifier.configure_field('year_start', flex=1)
fieldsModifier.configure_field('year_end', flex=1)
fieldsModifier.merge_fields('year_start', 'year_end', fieldLabel=T('Period'))
mytype = 'xcomboboxuserreset'
text = T('select...')
fieldsModifier.configure_field('id_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
""" people_selector
"""
virtdb.define_table('people_selector',
Field('year', 'integer', default=year),
Field('period_start', 'date'),
Field('period_end', 'date'),
Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')),
Field('category', 'string'),
Field('id_people_categories', 'reference people_categories', label= T("Quality")),
Field('id_events', 'reference events', label=T('Event')),
Field('format', 'string', default='html'))
virtdb.people_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES)
virtdb.people_selector.id_events.requires = IS_IN_DB(db, 'events.event')
virtdb.people_selector.id_people_categories.requires = IS_IN_DB(db, 'people_categories.code')
virtdb.people_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.people_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.people_selector.format.requires = IS_IN_SET(FORMATS)
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('people_selector')
fieldsModifier.configure_field('period_start', flex=1)
fieldsModifier.configure_field('period_end', flex=1)
fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period'))
mytype = 'xcomboboxuserreset'
text = T('select...')
fieldsModifier.configure_field('id_people_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
""" graph_selector
""" selector
"""
virtdb.define_table('graph_selector',
virtdb.define_table('selector',
Field('year_start', 'integer', default=year),
Field('year_end', 'integer'),
Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')),
Field('id_categories', 'reference categories', label= T("Category")),
Field('id_people_categories', 'reference people_categories', label= T("Quality")))
Field('id_fundings', 'reference fundings', label=T('Funding')),
Field('id_people_categories', 'reference alias_people_categories', label= T("People category")),
Field('id_people_code', 'reference people_categories', label= T("People quality")),
Field('id_object_categories', 'reference alias_object_categories', label= T("Object category")),
Field('id_object_code', 'reference object_categories', label= T("Object code")))
virtdb.graph_selector.id_categories.requires = \
IS_IN_DB(db, 'categories.category')
virtdb.graph_selector.id_people_categories.requires = \
virtdb.selector.id_object_categories.requires = \
IS_IN_DB(db, 'alias_object_categories.category')
virtdb.selector.id_object_code.requires = \
IS_IN_DB(db, 'object_categories.code')
virtdb.selector.id_people_categories.requires = \
IS_IN_DB(db, 'alias_people_categories.category')
virtdb.selector.id_people_code.requires = \
IS_IN_DB(db, 'people_categories.code')
virtdb.graph_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.graph_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.selector.id_fundings.requires = IS_IN_DB(db, 'fundings.agency')
virtdb.selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('graph_selector')
fieldsModifier = dbui.FieldsModifier('selector')
fieldsModifier.configure_field('year_start', flex=1)
fieldsModifier.configure_field('year_end', flex=1)
fieldsModifier.merge_fields('year_start', 'year_end', fieldLabel=T('Period'))
......@@ -33,7 +44,11 @@ mytype = 'xcomboboxuserreset'
text = T('select...')
fieldsModifier.configure_field('id_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_fundings', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_object_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_object_code', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_code', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
......
......@@ -80,11 +80,21 @@ cfgNode.add_child(T('the graphs'), to_grid('graphs'))
metaNode = Node(T('Metadata'))
metaNode.add_child(T('fundings'), to_grid('fundings'))
metaNode.add_child(T('teams'), to_grid('teams'))
metaNode.add_child(T('people'), to_grid('people'))
metaNode.add_child(T('people_categories'), to_grid('people_categories'))
metaNode.add_child(T('projects'), to_grid('projects'))
metaNode.sort_children()
#-------------------------------------------------------------------------------
#
# PEOPLE & OBJECT
#
#-------------------------------------------------------------------------------
objectNode = Node(T('People and objects'))
objectNode.add_child(T('people'), to_grid('people'))
objectNode.add_child(T('people_categories'), to_grid('people_categories'))
objectNode.add_child(T('objects'), to_grid('objects'))
objectNode.add_child(T('object_categories'), to_grid('object_categories'))
objectNode.sort_children()
#-------------------------------------------------------------------------------
#
# EVENT
......@@ -103,7 +113,7 @@ listNode = Node(T('The lists'))
for row in db(db.lists.id > 0).select(orderby=db.lists.name):