Commit 92c528ef authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Modified the database schema and polish the interface.

parent 7dc7d1dc
doc/database.png

91 KB | W: | H:

doc/database.png

100 KB | W: | H:

doc/database.png
doc/database.png
doc/database.png
doc/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="593" 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="phd_flag" null="1" autoincrement="0"><datatype>boolean</datatype></row><row name="hdr_flag" null="1" autoincrement="0"><datatype>boolean</datatype></row><row name="phd_date" null="1" autoincrement="0"><datatype>date</datatype></row><row name="hdr_date" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="596" y="281" name="teams"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="team" null="0" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="590" y="393" 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="932" y="139" name="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="definition" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="803" y="57" 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_categories" null="0" autoincrement="0"><datatype>integer</datatype><relation table="categories" row="id" /></row><row name="id_agencies" null="0" autoincrement="0"><datatype>integer</datatype><relation table="agencies" row="id" /></row><row name="cdd_flag" null="0" autoincrement="0"><datatype>boolean</datatype><default>False</default></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><key type="PRIMARY" name=""><part>id</part></key></table><table x="327" y="56" name="responsabilities"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="id_people" null="1" autoincrement="0"><datatype>integer</datatype><relation table="people" row="id" /></row><row name="id_teams" null="1" 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="responsability" null="0" autoincrement="0"><datatype>string</datatype></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="id_organizations" null="0" autoincrement="0"><datatype>integer</datatype><relation table="organizations" row="id" /></row><row name="id_levels" null="0" autoincrement="0"><datatype>integer</datatype><relation table="levels" row="id" /></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="348" y="316" name="hardware"><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="model" null="0" autoincrement="0"><datatype>string</datatype></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="cost" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="109" y="154" name="organizations"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="organization" null="0" autoincrement="0"><datatype>string</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="133" y="277" name="levels"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="level" null="0" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="805" y="339" name="budgets"><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="year" null="0" autoincrement="0"><datatype>integer</datatype></row><row name="line" null="1" autoincrement="0"><datatype>string</datatype></row><row name="demanded" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="notified" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="executed" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="937" y="266" name="agencies"><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></sql>
\ No newline at end of file
</datatypes><table x="593" 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="phd_flag" null="1" autoincrement="0"><datatype>boolean</datatype></row><row name="hdr_flag" null="1" autoincrement="0"><datatype>boolean</datatype></row><row name="phd_date" null="1" autoincrement="0"><datatype>date</datatype></row><row name="hdr_date" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="596" y="281" 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="594" y="398" name="projects"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="project" null="0" autoincrement="0"><datatype>string</datatype></row><row name="agencies" null="1" autoincrement="0"><datatype>string</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="932" y="139" name="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="usual" 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="803" y="57" 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_categories" null="0" autoincrement="0"><datatype>integer</datatype><relation table="categories" row="id" /></row><row name="id_agencies" null="0" autoincrement="0"><datatype>integer</datatype><relation table="agencies" row="id" /></row><row name="cdd_flag" null="0" autoincrement="0"><datatype>boolean</datatype><default>False</default></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><key type="PRIMARY" name=""><part>id</part></key></table><table x="327" y="56" name="responsibilities"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="id_people" null="1" autoincrement="0"><datatype>integer</datatype><relation table="people" row="id" /></row><row name="id_organizations" null="0" autoincrement="0"><datatype>integer</datatype><relation table="organizations" row="id" /></row><row name="responsibility" null="0" autoincrement="0"><datatype>string</datatype></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="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="348" y="316" name="hardware"><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="model" null="0" autoincrement="0"><datatype>string</datatype></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="cost" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="109" y="154" name="organizations"><row name="id" null="0" autoincrement="1"><datatype>integer</datatype></row><row name="organization" null="0" autoincrement="0"><datatype>string</datatype></row><row name="level" null="1" 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="805" y="339" name="budgets"><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="year" null="0" autoincrement="0"><datatype>integer</datatype></row><row name="line" null="1" autoincrement="0"><datatype>string</datatype></row><row name="demanded" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="notified" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="executed" null="1" autoincrement="0"><datatype>integer</datatype></row><row name="note" null="1" autoincrement="0"><datatype>text</datatype></row><key type="PRIMARY" name=""><part>id</part></key></table><table x="937" y="266" name="agencies"><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></sql>
\ No newline at end of file
# coding: utf8
{
'%Y-%m-%d': '%Y-%m-%d',
'Agencies': 'Agencies',
'Agency': 'Agence',
'Birth Date': 'Né le',
'CDD': 'CDD',
......@@ -13,6 +14,7 @@
'Cost': 'Coût',
'Definition': 'Définition',
'Demanded': 'Demandé',
'Domain': 'Domaine',
'End Date': 'Date de fin',
'Executed': 'Executé',
'Filter agencies': 'Filtrer les agences',
......@@ -25,7 +27,7 @@
'Filter organizations': 'Filtrer les organisations',
'Filter people': 'Filtrer les persones',
'Filter projects': 'Filtrer les projets',
'Filter responsabilities': 'Filtrer les responsabilités',
'Filter responsibilities': 'Filter les responsabilities',
'Filter teams': 'Filtrer les équipes',
'First Name': 'Prénom',
'Forms': 'Formulaire',
......@@ -55,13 +57,14 @@
'Phd defense date': 'Date de la soutenance de la thèse',
'Project': 'Projet',
'Ratio': 'Ratio',
'Responsability': 'Responsability',
'Responsibility': 'Responsabilité',
'Select': 'Selectionnez',
'Start Date': 'Date de début',
'Store': 'Store',
'Tables': 'Tables',
'Team': 'Équipe',
'Tools': 'Outils',
'Usual': 'Habituel',
'Year': 'Année',
'Year End': 'Year End',
'Year Start': 'Year Start',
......@@ -83,7 +86,7 @@
'people': 'personnel',
'plugin not install': 'plugin not install',
'projects': 'projets',
'responsabilities': 'responsabilités',
'responsibilities': 'responsabilités',
'select...': 'selectionner...',
'startswith': 'startswith',
'teams': 'équipes',
......
......@@ -63,13 +63,10 @@ db.define_table("agencies",
db.define_table("categories",
Field("code", "string", notnull=True),
Field("usual", "string"),
Field("definition", "text"),
migrate="categories.table")
db.define_table("levels",
Field("level", "string", notnull=True, unique=True),
migrate="levels.table")
db.define_table("people",
Field("first_name", "string", notnull=True),
Field("last_name", "string", notnull=True),
......@@ -84,15 +81,18 @@ db.define_table("people",
db.define_table("organizations",
Field("organization", "string", notnull=True, unique=True),
Field("note", "text"),
Field("level", "string", default=undef, notnull=True),
Field("definition", "text"),
migrate="organizations.table")
db.define_table("projects",
Field("project", "string", notnull=True, unique=True),
Field("agencies", "string"),
migrate="projects.table")
db.define_table("teams",
Field("team", "string", notnull=True, unique=True),
Field("domain", "string"),
migrate="teams.table")
#-------------------------------------------------------------------------------
......@@ -172,29 +172,17 @@ db.history.id_agencies.requires = \
IS_IN_DB(db, 'agencies.id', 'agencies.agency')
db.define_table("responsabilities",
db.define_table("responsibilities",
Field("id_people", db.people, default=undef_id, label='Person'),
Field("id_teams", db.teams, default=undef_id, label='Team'),
Field("id_projects", db.projects, default=undef_id, label='Project'),
Field("responsability", "text"),
Field("id_organizations", db.organizations, default=undef_id, label='Organization'),
Field("responsibility", "text"),
Field("start_date", "date", default=today, notnull=True),
Field("end_date", "date"),
Field("id_organizations", db.organizations, default=undef_id, label='Organization'),
Field("id_levels", db.levels, default=undef_id, label='Level'),
Field("note", "text"),
migrate="responsabilities.table")
migrate="responsibilities.table")
db.responsabilities.id_people.requires = \
db.responsibilities.id_people.requires = \
IS_IN_DB(db, 'people.id', 'people.last_name')
db.responsabilities.id_teams.requires = \
IS_IN_DB(db, 'teams.id', 'teams.team')
db.responsabilities.id_projects.requires = \
IS_IN_DB(db, 'projects.id', 'projects.project')
db.responsabilities.id_organizations.requires = \
db.responsibilities.id_organizations.requires = \
IS_IN_DB(db, 'organizations.id', 'organizations.organization')
db.responsabilities.id_levels.requires = \
IS_IN_DB(db, 'levels.id', 'levels.level')
......@@ -10,11 +10,8 @@ if not db(db.agencies.id).count():
if not db(db.categories.id).count():
db.categories.insert(id=undef_id, code=undef, definition=undef)
if not db(db.levels.id).count():
db.levels.insert(id=undef_id, level=undef)
if not db(db.organizations.id).count():
db.organizations.insert(id=undef_id, organization=undef)
db.organizations.insert(id=undef_id, organization=undef, level=undef)
if not db(db.people.id).count():
db.people.insert(id=undef_id, first_name=undef,
......
......@@ -27,10 +27,5 @@ if db(db.categories.id).count() == 1:
db.categories.insert(id=19, code='PHD')
db.categories.insert(id=20, code='ATER')
if db(db.levels.id).count() == 1:
db.levels.insert(id=2, level='local')
db.levels.insert(id=3, level='national')
db.levels.insert(id=4, level='international')
if db(db.teams.id).count() == 1:
db.teams.insert(id=2, team='LHCb')
......@@ -10,6 +10,13 @@ dbui.configure_grids(db, plugins=['pGridRowEditorConfirmDelete',
'pGridRowEditorDblClick',
'pGridExport'])
#
# categories
#
gridModifier = dbui.GridModifier('agencies')
gridModifier.configure_column('agency', width=40)
gridModifier.set_rownumbering()
#
# budgets
#
......@@ -29,7 +36,8 @@ gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
# categories
#
gridModifier = dbui.GridModifier('categories')
gridModifier.configure_column('code', width=15)
gridModifier.configure_column('code', width=20)
gridModifier.configure_column('usual', width=20)
gridModifier.set_rownumbering()
#
......@@ -37,12 +45,15 @@ gridModifier.set_rownumbering()
#
gridModifier = dbui.GridModifier('hardware')
gridModifier.append_plugins('pGridPaging', 'pGridExport')
gridModifier.hide_columns('id_projects', 'id_teams')
gridModifier.set_rownumbering()
gridModifier.append_filter(('people.last_name', 'contains', T('contains')))
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
gridModifier.append_filter(('id_projects', '==', T('is equal to')))
gridModifier.append_filter(('model', 'contains', T('contains')))
gridModifier.append_filter(('start_date', '>=', T('greater or equal to')))
gridModifier.append_filter(('end_date', '<=', T('less or equal to')))
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
......@@ -51,6 +62,7 @@ gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
#
gridModifier = dbui.GridModifier('history')
gridModifier.append_plugins('pGridPaging', 'pGridExport')
gridModifier.hide_columns('id_projects', 'id_agencies')
gridModifier.set_rownumbering()
gridModifier.append_filter(('people.last_name', 'contains', T('contains')))
......@@ -77,17 +89,32 @@ gridModifier.append_filter(('initials', 'startswith', T('startswith')))
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
#
# projects
#
gridModifier = dbui.GridModifier('projects')
gridModifier.configure_column('project', width=20)
gridModifier.set_rownumbering()
#
# responsibilities
#
gridModifier = dbui.GridModifier('responsabilities')
gridModifier = dbui.GridModifier('responsibilities')
gridModifier.configure_column('responsibility', width=400)
gridModifier.hide_columns('id_organizations', 'note')
gridModifier.append_plugins('pGridPaging', 'pGridExport')
gridModifier.append_filter(('start_date', '>=', T('greater or equal to')))
gridModifier.append_filter(('end_date', '<=', T('less or equal to')))
gridModifier.set_rownumbering()
gridModifier.append_filter(('people.last_name', 'contains', T('contains')))
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
gridModifier.append_filter(('id_projects', '==', T('is equal to')))
gridModifier.append_filter(('id_organizations', '==', T('is equal to')))
gridModifier.append_filter(('id_levels', '==', T('is equal to')))
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
\ No newline at end of file
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
#
# teams
#
gridModifier = dbui.GridModifier('teams')
gridModifier.configure_column('team', width=20)
gridModifier.set_rownumbering()
......@@ -17,9 +17,6 @@ storeModifier.orderby(db.people.last_name, db.hardware.start_date)
storeModifier = dbui.StoreModifier('history')
storeModifier.orderby(db.people.last_name, db.history.start_date)
storeModifier = dbui.StoreModifier('levels')
storeModifier.orderby(db.levels.level)
storeModifier = dbui.StoreModifier('organizations')
storeModifier.orderby(db.organizations.organization)
......@@ -29,8 +26,8 @@ storeModifier.orderby(db.people.last_name)
storeModifier = dbui.StoreModifier('projects')
storeModifier.orderby(db.projects.project)
storeModifier = dbui.StoreModifier('responsabilities')
storeModifier.orderby(db.people.last_name, db.responsabilities.start_date)
storeModifier = dbui.StoreModifier('responsibilities')
storeModifier.orderby(db.people.last_name, db.responsibilities.start_date)
storeModifier = dbui.StoreModifier('teams')
storeModifier.orderby(db.teams.team)
\ No newline at end of file
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