forked from sahana/eden
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.py
87 lines (61 loc) · 2.32 KB
/
stats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# -*- coding: utf-8 -*-
"""
Sahana Eden Stats Controller
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def parameter():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def data():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def source():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def demographic():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def demographic_data():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def demographic_aggregate():
""" REST Controller """
def clear_aggregates(r, **attr):
if not s3_has_role(ADMIN):
auth.permission.fail()
s3db.stats_demographic_rebuild_all_aggregates()
redirect(URL(c="stats",
f="demographic_aggregate",
args="",
))
s3db.set_method("stats", "demographic_aggregate",
method="clear",
action=clear_aggregates)
output = s3_rest_controller()
return output
# -----------------------------------------------------------------------------
def people_type():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def people():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def trained_type():
""" REST Controller """
return s3_rest_controller()
# -----------------------------------------------------------------------------
def trained():
""" REST Controller """
return s3_rest_controller()
# END =========================================================================