Commit 1f54a388 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Remove the obsolete metric controller and views.

parent 1548bc77
""" Metric controllers
"""
from reporting_tools import MySelector, CountPeople
BASE_VIEW = 'report.%s'
def people_per_category():
"""Count the number of active people per category during a given
period of time, for a given team, ...
"""
selector = MySelector(virtdb.people_selector,
exclude_fields=('category',
'period_start',
'period_end',
'year'))
field = db.people_categories.category
count = CountPeople(field)
rows = count(selector)
# get the header and publish
header = '%s %s' % (T('People per category'), selector.header(db))
response.view = BASE_VIEW % request.extension
return dict(field=field, footer='', header=header, rows=rows)
def people_per_quality():
"""Count the number of active people per quality during a given
period of time, for a given team, ...
"""
selector = MySelector(virtdb.people_selector,
exclude_fields=('category',
'period_start',
'period_end',
'year'))
field = db.people_categories.code
count = CountPeople(field)
rows = count(selector)
# get the header and publish
header = '%s %s' % (T('People per quality'), selector.header(db))
response.view = BASE_VIEW % request.extension
return dict(field=field, footer='', header=header, rows=rows)
def people_per_team():
"""Count the number of active people per team during a given
period of time, for a given category, ...
"""
selector = MySelector(virtdb.people_selector,
exclude_fields=('category',
'period_start',
'period_end',
'year'))
field = db.teams.team
count = CountPeople(field)
rows = count(selector)
# get the header and publish
header = '%s %s' % (T('People per team'), selector.header(db))
response.view = BASE_VIEW % request.extension
return dict(field=field, footer='', header=header, rows=rows)
{{
# regular columns to be displayed in the view
columns = [str(field),
'COUNT(DISTINCT people.id)',
'coverage',
'FTE']
# labels for regular columns
headers = {'COUNT(DISTINCT people.id)': T('Person'),
'coverage': T('Coverage'),
'FTE': T('FTE')}
headers[str(field)] = T(field.name.title())
# virtual fields to be displayed in the view
extracolumns = []
}}
{{include 'metric/people.cfg'}}
\ No newline at end of file
{{include 'metric/people.cfg'}}
\ No newline at end of file
{{include 'metric/people.cfg'}}
\ 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