Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
0dcffdf6
Commit
0dcffdf6
authored
8 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Add reporthandler class
parent
06d1fa09
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/handlers/reporthandler.py
+69
-0
69 additions, 0 deletions
api/handlers/reporthandler.py
with
69 additions
and
0 deletions
api/handlers/reporthandler.py
0 → 100644
+
69
−
0
View file @
0dcffdf6
import
json
from
..
import
base
from
..
import
config
log
=
config
.
log
Report
=
util
.
Enum
(
'
Report
'
,
{
'
site
'
:
report
.
SiteReport
,
'
project
'
:
report
.
ProjectReport
})
class
ReportHandler
(
base
.
RequestHandler
):
def
__init__
(
self
,
request
=
None
,
response
=
None
):
super
(
SchemaHandler
,
self
).
__init__
(
request
,
response
)
def
get
(
self
,
report_type
,
**
kwargs
):
return
{
'
type
'
:
report_type
}
class
Report
(
object
):
def
__init__
(
self
):
self
.
placeholder
=
None
def
build_report
(
self
):
"""
Build and return a json report
"""
raise
NotImplementedError
()
class
SiteReport
(
Report
):
"""
Report of statistics about the site, generated by Site Managers
Report includes:
- number of groups
- number of projects per group
- number of sessions per group
"""
def
build_report
(
self
):
pass
class
ProjectReport
(
Report
):
"""
Report of statistics about a list of projects, generated by
Project Admins or Group Admins. Will only include a date range
when provided by the client.
Report includes:
- Project Name
- Group Name
- Project Admin(s)
- Number of Sessions
- Unique Subjects
- Male Subjects
- Female Subjects
- Subjects under 18
- Subjects over 18
"""
def
__init__
(
self
,
projects
,
start_date
=
None
,
end_date
=
None
):
super
(
ProjectReport
,
self
).
__init__
()
self
.
projects
=
projects
self
.
start_date
=
start_date
self
.
end_date
=
end_date
def
build_report
(
self
):
pass
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment