Copyright (C) 2012, University of Cambridge, Department of Psychiatry. Created by Rudolf Cardinal (email@example.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 <https://www.gnu.org/licenses/>.
Representation of the client devices.
- class camcops_server.cc_modules.cc_device.Device(**kwargs)[source]¶
Represents a tablet (client) device.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- classmethod get_device_by_id(dbsession: sqlalchemy.orm.session.Session, device_id: int) Optional[camcops_server.cc_modules.cc_device.Device] [source]¶
Returns a device by its integer ID.
- classmethod get_device_by_name(dbsession: sqlalchemy.orm.session.Session, device_name: str) Optional[camcops_server.cc_modules.cc_device.Device] [source]¶
Returns a device by its name.
- get_friendly_name_and_id() str [source]¶
Get a formatted representation of the device (name, ID, friendly name).
- classmethod get_server_device(dbsession: sqlalchemy.orm.session.Session) camcops_server.cc_modules.cc_device.Device [source]¶
Return the special device meaning “the server”, creating it if it doesn’t already exist.
- class camcops_server.cc_modules.cc_device.DeviceReport[source]¶
Report to show registered devices. This is a superuser-only report, so we do not override superuser_only.
- get_query(req: CamcopsRequest) sqlalchemy.orm.query.Query [source]¶
Overriding this function is one way of providing a report. (The other is
To override this function, return the SQLAlchemy Base
Selectstatement or the SQLAlchemy ORM
Queryto execute the report.
Parameters are passed in via the request.