Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
e0cffb9f
Commit
e0cffb9f
authored
Dec 04, 2012
by
LE GAC Renaud
Browse files
Add the basic logic to count the number of people.
parent
4c228b6b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
3 deletions
+34
-3
controllers/metric.py
controllers/metric.py
+26
-0
languages/fr-fr.py
languages/fr-fr.py
+1
-0
models/widgets_viewport.py
models/widgets_viewport.py
+7
-3
No files found.
controllers/metric.py
0 → 100644
View file @
e0cffb9f
""" 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'
languages/fr-fr.py
View file @
e0cffb9f
...
...
@@ -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'
,
...
...
models/widgets_viewport.py
View file @
e0cffb9f
...
...
@@ -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'
),
p
eopleLeaf
)
reportNode
.
add_child
(
T
(
'List of people'
),
listP
eopleLeaf
)
reportNode
.
add_child
(
T
(
'List of responsibilities'
),
respLeaf
)
reportNode
.
sort_children
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment