Skip to content
Snippets Groups Projects
Commit 0dcffdf6 authored by Megan Henning's avatar Megan Henning
Browse files

Add reporthandler class

parent 06d1fa09
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment