15.2.95. camcops_server.cc_modules.cc_dummy_database

camcops_server/cc_modules/cc_dummy_database.py


Copyright (C) 2012, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (rnc1001@cam.ac.uk).

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 <https://www.gnu.org/licenses/>.


Functions for dummy database creation for manual testing.

class camcops_server.cc_modules.cc_dummy_database.DummyDataFactory(cfg: CamcopsConfig)[source]

Factory to insert random data (within constraints) to tasks and other objects in a dummy database. Unlike its parent, this concerns itself with an actual data.

__init__(cfg: CamcopsConfig) None[source]
apply_standard_db_fields(obj: GenericTabletRecordMixin) None[source]

Writes some default values to an SQLAlchemy ORM object representing a record uploaded from a client (tablet) device.

apply_standard_task_fields(task: camcops_server.cc_modules.cc_task.Task) None[source]

Writes some default values to an SQLAlchemy ORM object representing a task.

class camcops_server.cc_modules.cc_dummy_database.DummyDataInserter[source]

Class to insert random data (within constraints) to tasks and other objects. It does not touch an actual database, so its methods can be used for free-floating items.

__init__() None[source]
fill_in_task_fields(task: camcops_server.cc_modules.cc_task.Task) None[source]

Inserts random data into a task (within any known constraints).