14.2.50. camcops_server.cc_modules.cc_dump

camcops_server/cc_modules/cc_dump.py


Copyright (C) 2012-2019 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/>.


Methods for providing a dump of data from the server to the web user.

class camcops_server.cc_modules.cc_dump.DumpController(dst_engine: sqlalchemy.engine.base.Engine, dst_session: sqlalchemy.orm.session.Session, export_options: TaskExportOptions, req: CamcopsRequest)[source]

A controller class that manages the copying (dumping) of information from our database to another SQLAlchemy Engine/Session.

Parameters:
consider_object(src_obj: object) → None[source]

Think about an SQLAlchemy ORM object. If it comes from a table we want dumped, add this object to the dump.

camcops_server.cc_modules.cc_dump.copy_tasks_and_summaries(tasks: Iterable[camcops_server.cc_modules.cc_task.Task], dst_engine: sqlalchemy.engine.base.Engine, dst_session: sqlalchemy.orm.session.Session, export_options: TaskExportOptions, req: CamcopsRequest) → None[source]

Copy a set of tasks, and their associated related information (found by walking the SQLAlchemy ORM tree), to the dump.

Parameters: