14.2.63. camcops_server.cc_modules.cc_group

camcops_server/cc_modules/cc_group.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/>.


Group definitions.

class camcops_server.cc_modules.cc_group.Group(**kwargs)[source]

Represents a CamCOPS group.

See “Groups” in the CamCOPS documentation.

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

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 all_group_ids(dbsession: sqlalchemy.orm.session.Session) → List[int][source]

Returns all group IDs.

classmethod get_all_groups(dbsession: sqlalchemy.orm.session.Session) → List[_ForwardRef('Group')][source]

Returns all groups.

classmethod get_group_by_id(dbsession: sqlalchemy.orm.session.Session, group_id: int) → Union[_ForwardRef('Group'), NoneType][source]

Fetches a group from its integer ID.

classmethod get_group_by_name(dbsession: sqlalchemy.orm.session.Session, name: str) → Union[_ForwardRef('Group'), NoneType][source]

Fetches a group from its name.

classmethod get_groups_from_id_list(dbsession: sqlalchemy.orm.session.Session, group_ids: List[int]) → List[_ForwardRef('Group')][source]

Fetches groups from a list of group IDs.

classmethod group_exists(dbsession: sqlalchemy.orm.session.Session, group_id: int) → bool[source]

Does a particular group (specified by its integer ID) exist?

ids_of_groups_group_may_see() → Set[int][source]

Returns a list of group IDs for groups that this group has permission to see. (Always includes our own group number.)

ids_of_other_groups_group_may_see() → Set[int][source]

Returns a list of group IDs for groups that this group has permission to see. (Always includes our own group number.)

tokenized_finalize_policy() → camcops_server.cc_modules.cc_policy.TokenizedPolicy[source]

Returns the finalize policy for a group.

tokenized_upload_policy() → camcops_server.cc_modules.cc_policy.TokenizedPolicy[source]

Returns the upload policy for a group.