19.1.46. camcops_server.cc_modules.cc_taskfactory¶
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_taskfactory.
FetchThread
(req: camcops_server.cc_modules.cc_request.CamcopsRequest, task_class: Type[camcops_server.cc_modules.cc_task.Task], factory: camcops_server.cc_modules.cc_taskfactory.TaskCollection, **kwargs)[source]¶ CURRENTLY UNUSED.
-
run
() → None[source]¶ Method representing the thread’s activity.
You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.
-
-
class
camcops_server.cc_modules.cc_taskfactory.
TaskCollection
(req: camcops_server.cc_modules.cc_request.CamcopsRequest, taskfilter: camcops_server.cc_modules.cc_taskfilter.TaskFilter, as_dump: bool = False, sort_method_by_class: camcops_server.cc_modules.cc_taskfactory.TaskSortMethod = <TaskSortMethod.NONE: 0>, sort_method_global: camcops_server.cc_modules.cc_taskfactory.TaskSortMethod = <TaskSortMethod.NONE: 0>, current_only: bool = True)[source]¶ Represent a potential or instantiated call to fetch tasks from the database. The caller may want them in a giant list (e.g. task viewer, CTVs), or split by task class (e.g. trackers).
-
camcops_server.cc_modules.cc_taskfactory.
task_factory
(req: camcops_server.cc_modules.cc_request.CamcopsRequest, basetable: str, serverpk: int) → Union[camcops_server.cc_modules.cc_task.Task, NoneType][source]¶ Make a task; return None if the PK doesn’t exist; raise HTTPBadRequest if the table doesn’t exist.