19.1.34. camcops_server.cc_modules.cc_report¶
Copyright (C) 2012-2018 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CamCOPS.
CamCOPS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
CamCOPS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with CamCOPS. If not, see <http://www.gnu.org/licenses/>.
-
class
camcops_server.cc_modules.cc_report.
Report
[source]¶ Abstract base class representing a report.
Must override attributes:
- report_id
- String used in HTML selector
- report_title
- String for display purposes
- get_rows_descriptions
- returns the actual data; the request data will have been pre- validated against the report’s form
- get_schema_class
- Schema used to create a form for seeking parameters; override this for simple parameter collection (if you just override this, you’ll get a ReportParamForm with this schema).
- get_form
- Schema used to create a form for seeking parameters; override this for full control over parameter collection.
-
classmethod
all_subclasses
(sort_title: bool = False) → List[Type[Report]][source]¶ Get all report subclasses, except those not implementing their report_id property.
-
get_query
(req: CamcopsRequest) → Union[NoneType, sqlalchemy.sql.selectable.SelectBase, sqlalchemy.orm.query.Query][source]¶ Return the Select statement to execute the report. Must override. Parameters are passed in via the Request.