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

Add the basic logic to count the number of people.

parent 4c228b6b
""" Metric controllers
"""
from reporting_tools import MySelector
def people():
"""Count the number of active people for a given period of time,
given team, ...
"""
selector = MySelector(virtdb.people_selector,
exclude_fields=('category',
'year',
'period_start',
'period_end'))
# add constraint to avoid event diploma, distinction,...
selector.append_query(db.history.id_events == undef_id)
# add constraints to select category of people
if selector.category:
selector.append_query(db.categories.category == selector.category)
return 'hello'
......@@ -25,6 +25,7 @@
'Contract': 'Contrat',
'Controller': 'Controller',
'Cost': 'Coût',
'Count people': 'Nombre de personne',
'Coverage': 'Coverage',
'Coût': 'Coût',
'database schema': 'schéma de la base de données',
......
......@@ -12,8 +12,9 @@ gridNode.add_children(db.tables, func=configurator)
#
# report node
#
peopleLeaf = dbui.to_panelWithUrlSelector(virtdb.people_selector,
baseUrl=URL('list', 'people'))
countPeopleLeaf = dbui.to_panelWithUrlSelector(virtdb.people_selector,
baseUrl=URL('metric', 'people'))
hardwareLeaf = dbui.to_panelWithUrlSelector(virtdb.hardware_selector,
baseUrl=URL('list', 'hardware'))
......@@ -22,15 +23,18 @@ hardwareLeaf = dbui.to_panelWithUrlSelector(virtdb.hardware_selector,
historyLeaf = dbui.to_panelWithUrlSelector(virtdb.history_selector,
baseUrl=URL('list', 'history'))
listPeopleLeaf = dbui.to_panelWithUrlSelector(virtdb.people_selector,
baseUrl=URL('list', 'people'))
respLeaf = dbui.to_panelWithUrlSelector(virtdb.responsibilities_selector,
baseUrl=URL('list', 'responsibilities'))
reportNode = dbui.Node(T('Reports'))
reportNode.add_child(T('Count people'), countPeopleLeaf)
reportNode.add_child(T('History'), historyLeaf)
reportNode.add_child(T('List of hardware'), hardwareLeaf)
reportNode.add_child(T('List of people'), peopleLeaf)
reportNode.add_child(T('List of people'), listPeopleLeaf)
reportNode.add_child(T('List of responsibilities'), respLeaf)
reportNode.sort_children()
......
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