14.2.47. camcops_server.cc_modules.cc_forms

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


Forms for use by the web front end.

COLANDER NODES, NULLS, AND VALIDATION

  • Surprisingly tricky.

  • Nodes must be validly intialized with NO USER-DEFINED PARAMETERS to __init__; the Deform framework clones them.

  • A null appstruct is used to initialize nodes as Forms are created. Therefore, the “default” value must be acceptable to the underlying type’s serialize() function. Note in particular that “default = None” is not acceptable to Integer. Having no default is fine, though.

  • In general, flexible inheritance is very hard to implement.

  • Note that this error:

    AttributeError: 'EditTaskFilterSchema' object has no attribute 'typ'
    

    means you have failed to call super().__init__() properly from __init__().

  • When creating a schema, its members seem to have to be created in the class declaration as class properties, not in __init__().

class camcops_server.cc_modules.cc_forms.AddCancelForm(schema_class: Type[colander.Schema], request: CamcopsRequest, **kwargs)[source]

Form with “add” and “cancel” buttons.

class camcops_server.cc_modules.cc_forms.AddGroupForm(request: CamcopsRequest, **kwargs)[source]

Form to add a group.

class camcops_server.cc_modules.cc_forms.AddGroupSchema(*arg, **kw)[source]

Schema to add a group.

class camcops_server.cc_modules.cc_forms.AddIdDefinitionForm(request: CamcopsRequest, **kwargs)[source]

Form to add an ID number definition.

class camcops_server.cc_modules.cc_forms.AddIdDefinitionSchema(*arg, **kw)[source]

Schema to add an ID number definition.

class camcops_server.cc_modules.cc_forms.AddSpecialNoteForm(request: CamcopsRequest, **kwargs)[source]

Form to add a special note to a task.

class camcops_server.cc_modules.cc_forms.AddSpecialNoteSchema(*arg, **kw)[source]

Schema to add a special note to a task.

class camcops_server.cc_modules.cc_forms.AddUserGroupadminForm(request: CamcopsRequest, **kwargs)[source]

Form to add a user. Version for group administrators.

class camcops_server.cc_modules.cc_forms.AddUserGroupadminSchema(*arg, **kw)[source]

Schema to add a user. Version for group administrators.

class camcops_server.cc_modules.cc_forms.AddUserSuperuserForm(request: CamcopsRequest, **kwargs)[source]

Form to add a user. Version for superusers.

class camcops_server.cc_modules.cc_forms.AddUserSuperuserSchema(*arg, **kw)[source]

Schema to add a user. Version for superusers.

class camcops_server.cc_modules.cc_forms.AdministeredGroupsSequence(*args, **kwargs)[source]

Sequence to offer a choice of the groups administered by the requestor.

Typical use: (non-superuser) group administrator assigns group memberships to a user.

class camcops_server.cc_modules.cc_forms.AllGroupsSequence(*args, minimum_number: int = 0, **kwargs)[source]

Sequence to offer a choice of all possible groups.

Typical use: superuser assigns group memberships to a user.

class camcops_server.cc_modules.cc_forms.AllOtherGroupsSequence(*args, minimum_number: int = 0, **kwargs)[source]

Sequence to offer a choice of all possible OTHER groups (as determined relative to the group specified in kw[Binding.GROUP]).

Typical use: superuser assigns group permissions to another group.

class camcops_server.cc_modules.cc_forms.AllowedGroupsSequence(*args, minimum_number: int = 0, **kwargs)[source]

Sequence to offer a choice of all the groups the user is allowed to see.

class camcops_server.cc_modules.cc_forms.ApplyCancelForm(schema_class: Type[colander.Schema], request: CamcopsRequest, **kwargs)[source]

Form with “apply” and “cancel” buttons.

class camcops_server.cc_modules.cc_forms.AuditTrailForm(request: CamcopsRequest, **kwargs)[source]

Form to filter and then view audit trail entries.

class camcops_server.cc_modules.cc_forms.AuditTrailSchema(*arg, **kw)[source]

Schema to filter audit trail entries.

class camcops_server.cc_modules.cc_forms.Binding[source]

Keys used for binding dictionaries with Colander schemas (schemata).

Must match kwargs of calls to bind() function of each Schema.

class camcops_server.cc_modules.cc_forms.BootstrapCssClasses[source]

Constants from Bootstrap to control display.

class camcops_server.cc_modules.cc_forms.CSRFSchema(*arg, **kw)[source]

Base class for form schemas that use CSRF (XSRF; cross-site request forgery) tokens.

You can’t put the call to bind() at the end of __init__(), because bind() calls clone() with no arguments and clone() ends up calling __init__()`

class camcops_server.cc_modules.cc_forms.CSRFToken(*arg, **kw)[source]

Node to embed a cross-site request forgery (CSRF) prevention token in a form.

As per http://deformdemo.repoze.org/pyramid_csrf_demo/, modified for a more recent Colander API.

NOTE that this makes use of colander.SchemaNode.bind; this CLONES the Schema, and resolves any deferred values by means of the keywords passed to bind(). Since the Schema is created at module load time, but since we’re asking the Schema to know about the request’s CSRF values, this is the only mechanism (https://docs.pylonsproject.org/projects/colander/en/latest/api.html#colander.SchemaNode.bind).

From http://deform2000.readthedocs.io/en/latest/basics.html:

“The default of a schema node indicates the value to be serialized if a value for the schema node is not found in the input data during serialization. It should be the deserialized representation. If a schema node does not have a default, it is considered “serialization required”.”

“The missing of a schema node indicates the value to be deserialized if a value for the schema node is not found in the input data during deserialization. It should be the deserialized representation. If a schema node does not have a missing value, a colander.Invalid exception will be raised if the data structure being deserialized does not contain a matching value.”

RNC: Serialized values are always STRINGS.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.ChangeOtherPasswordForm(request: CamcopsRequest, **kwargs)[source]

Form to change another user’s password.

class camcops_server.cc_modules.cc_forms.ChangeOtherPasswordSchema(*arg, **kw)[source]

Schema to change another user’s password.

class camcops_server.cc_modules.cc_forms.ChangeOwnPasswordForm(request: CamcopsRequest, must_differ: bool = True, **kwargs)[source]

Form to change one’s own password.

Parameters:must_differ – must the new password be different from the old one?
class camcops_server.cc_modules.cc_forms.ChangeOwnPasswordSchema(*args, must_differ: bool = True, **kwargs)[source]

Schema to change one’s own password.

Parameters:must_differ – must the new password be different from the old one?
class camcops_server.cc_modules.cc_forms.ChooseTrackerForm(request: CamcopsRequest, as_ctv: bool, **kwargs)[source]

Form to select a tracker or CTV.

Parameters:as_ctv – CTV, not tracker?
class camcops_server.cc_modules.cc_forms.ChooseTrackerSchema(*arg, **kw)[source]

Schema to select a tracker or CTV.

class camcops_server.cc_modules.cc_forms.DangerousForm(schema_class: Type[colander.Schema], submit_action: str, submit_title: str, request: CamcopsRequest, **kwargs)[source]

Form with one “submit” button (with user-specifiable title text and action name), in a CSS class indicating that it’s a dangerous operation, plus a “Cancel” button.

class camcops_server.cc_modules.cc_forms.DatabaseDialectSelector(*args, **kwargs)[source]

Node to choice an SQL dialect (for viewing DDL).

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.DeleteCancelForm(schema_class: Type[colander.Schema], request: CamcopsRequest, **kwargs)[source]

Form with a “delete” button (visually marked as dangerous) and a “cancel” button.

class camcops_server.cc_modules.cc_forms.DeleteGroupForm(request: CamcopsRequest, **kwargs)[source]

Form to delete a group.

class camcops_server.cc_modules.cc_forms.DeleteGroupSchema(*arg, **kw)[source]

Schema to delete a group.

class camcops_server.cc_modules.cc_forms.DeleteIdDefinitionForm(request: CamcopsRequest, **kwargs)[source]

Form to add an ID number definition.

class camcops_server.cc_modules.cc_forms.DeleteIdDefinitionSchema(*arg, **kw)[source]

Schema to delete an ID number definition.

class camcops_server.cc_modules.cc_forms.DeletePatientChooseForm(request: CamcopsRequest, **kwargs)[source]

Form to delete a patient.

class camcops_server.cc_modules.cc_forms.DeletePatientChooseSchema(*arg, **kw)[source]

Schema to delete a patient.

class camcops_server.cc_modules.cc_forms.DeletePatientConfirmForm(request: CamcopsRequest, **kwargs)[source]

Form to confirm deletion of a patient.

class camcops_server.cc_modules.cc_forms.DeletePatientConfirmSchema(*arg, **kw)[source]

Schema to confirm deletion of a patient.

class camcops_server.cc_modules.cc_forms.DeleteUserForm(request: CamcopsRequest, **kwargs)[source]

Form to delete a user.

class camcops_server.cc_modules.cc_forms.DeleteUserSchema(*arg, **kw)[source]

Schema to delete a user.

class camcops_server.cc_modules.cc_forms.DevicesSequence(*args, **kw)[source]

Sequence to capture multiple client devices (for task filters: “uploaded by one of the following devices…”).

class camcops_server.cc_modules.cc_forms.DumpTypeSelector(*arg, **kw)[source]

Node to select the filtering method for a data dump.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.EditGroupForm(request: CamcopsRequest, group: camcops_server.cc_modules.cc_group.Group, **kwargs)[source]

Form to edit a group.

class camcops_server.cc_modules.cc_forms.EditGroupSchema(*arg, **kw)[source]

Schema to edit a group.

class camcops_server.cc_modules.cc_forms.EditIdDefinitionForm(request: CamcopsRequest, **kwargs)[source]

Form to edit an ID number definition.

class camcops_server.cc_modules.cc_forms.EditIdDefinitionSchema(*arg, **kw)[source]

Schema to edit an ID number definition.

class camcops_server.cc_modules.cc_forms.EditPatientForm(request: CamcopsRequest, **kwargs)[source]

Form to edit a patient.

class camcops_server.cc_modules.cc_forms.EditPatientSchema(*arg, **kw)[source]

Schema to edit a patient.

class camcops_server.cc_modules.cc_forms.EditServerSettingsForm(request: CamcopsRequest, **kwargs)[source]

Form to edit the global settings for the server.

class camcops_server.cc_modules.cc_forms.EditServerSettingsSchema(*arg, **kw)[source]

Schema to edit the global settings for the server.

class camcops_server.cc_modules.cc_forms.EditTaskFilterAdminSchema(*arg, **kw)[source]

Schema to edit the “admin” parts of a task filter.

class camcops_server.cc_modules.cc_forms.EditTaskFilterForm(request: CamcopsRequest, open_who: bool = False, open_what: bool = False, open_when: bool = False, open_admin: bool = False, **kwargs)[source]

Form to edit a task filter.

class camcops_server.cc_modules.cc_forms.EditTaskFilterSchema(*arg, **kw)[source]

Schema to edit a task filter.

class camcops_server.cc_modules.cc_forms.EditTaskFilterWhatSchema(*arg, **kw)[source]

Schema to edit the “what” parts of a task filter.

class camcops_server.cc_modules.cc_forms.EditTaskFilterWhenSchema(*arg, **kw)[source]

Schema to edit the “when” parts of a task filter.

class camcops_server.cc_modules.cc_forms.EditTaskFilterWhoSchema(*arg, **kw)[source]

Schema to edit the “who” parts of a task filter.

class camcops_server.cc_modules.cc_forms.EditUserFullForm(request: CamcopsRequest, **kwargs)[source]

Form to edit a user. Full version for superusers.

class camcops_server.cc_modules.cc_forms.EditUserFullSchema(*arg, **kw)[source]

Schema to edit a user. Version for superusers; can also make the user a superuser.

class camcops_server.cc_modules.cc_forms.EditUserGroupAdminForm(request: CamcopsRequest, **kwargs)[source]

Form to edit a user. Version for group administrators.

class camcops_server.cc_modules.cc_forms.EditUserGroupAdminSchema(*arg, **kw)[source]

Schema to edit a user. Version for group administrators.

class camcops_server.cc_modules.cc_forms.EditUserGroupMembershipGroupAdminForm(request: CamcopsRequest, **kwargs)[source]

Form to edit a user’s permissions within a group. Version for group administrators.

class camcops_server.cc_modules.cc_forms.EditUserGroupPermissionsFullForm(request: CamcopsRequest, **kwargs)[source]

Form to edit a user’s permissions within a group. Version for superusers.

class camcops_server.cc_modules.cc_forms.EndDateSelector(*arg, **kw)[source]

Optional node to select an end date (in UTC).

class camcops_server.cc_modules.cc_forms.EndDateTimeSelector(*arg, **kw)[source]

Optional node to select an end date/time (in UTC).

class camcops_server.cc_modules.cc_forms.EndPendulumSelector(*arg, **kw)[source]

Optional node to select an end date/time.

class camcops_server.cc_modules.cc_forms.EraseTaskForm(request: CamcopsRequest, **kwargs)[source]

Form to erase a task.

class camcops_server.cc_modules.cc_forms.EraseTaskSchema(*arg, **kw)[source]

Schema to erase a task.

class camcops_server.cc_modules.cc_forms.ExportedTaskListForm(request: CamcopsRequest, **kwargs)[source]

Form to filter and then view exported task logs.

class camcops_server.cc_modules.cc_forms.ExportedTaskListSchema(*arg, **kw)[source]

Schema to filter HL7 message logs.

class camcops_server.cc_modules.cc_forms.ForciblyFinalizeChooseDeviceForm(request: CamcopsRequest, **kwargs)[source]

Form to force-finalize records from a device.

class camcops_server.cc_modules.cc_forms.ForciblyFinalizeChooseDeviceSchema(*arg, **kw)[source]

Schema to force-finalize records from a device.

class camcops_server.cc_modules.cc_forms.ForciblyFinalizeConfirmForm(request: CamcopsRequest, **kwargs)[source]

Form to confirm force-finalizing of a device.

class camcops_server.cc_modules.cc_forms.ForciblyFinalizeConfirmSchema(*arg, **kw)[source]

Schema to confirm force-finalizing of a device.

class camcops_server.cc_modules.cc_forms.FormInlineCssMixin(*args, **kwargs)[source]

Modification to a Deform form that makes it display “inline” via CSS. This has the effect of wrapping everything horizontally.

Should PRECEDE the Form (or something derived from it) in the inheritance order.

class camcops_server.cc_modules.cc_forms.GroupsSequenceBase(*args, minimum_number: int = 0, **kwargs)[source]

Sequence schema to capture zero or more non-duplicate groups.

class camcops_server.cc_modules.cc_forms.HardWorkConfirmationSchema(*arg, **kw)[source]

Schema to make it hard to do something. We require a pattern of yes/no answers before we will proceed.

class camcops_server.cc_modules.cc_forms.Hl7AssigningAuthorityNode(*arg, **kw)[source]

Optional node to capture the name of an HL7 Assigning Authority.

class camcops_server.cc_modules.cc_forms.Hl7IdTypeNode(*arg, **kw)[source]

Optional node to capture the name of an HL7 Identifier Type code.

class camcops_server.cc_modules.cc_forms.HorizontalFormMixin(schema: colander.Schema, *args, **kwargs)[source]

Modification to a Deform form that displays itself with horizontal layout, using custom templates via HorizontalFormWidget. Not fantastic.

class camcops_server.cc_modules.cc_forms.HorizontalFormWidget(**kw)[source]

Widget to render a form horizontally, with custom templates.

See deform.template.ZPTRendererFactory, which explains how strings are resolved to Chameleon ZPT (Zope) templates.

See

class camcops_server.cc_modules.cc_forms.IdDefinitionDescriptionNode(*arg, **kw)[source]

Node to capture the description of an ID number type.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.IdDefinitionShortDescriptionNode(*arg, **kw)[source]

Node to capture the short description of an ID number type.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.IdNumSequenceAnyCombination(*args, **kw)[source]

Sequence to capture multiple ID numbers (as type/value pairs).

class camcops_server.cc_modules.cc_forms.IdNumSequenceUniquePerWhichIdnum(*args, **kw)[source]

Sequence to capture multiple ID numbers (as type/value pairs) but with only up to one per ID number type.

class camcops_server.cc_modules.cc_forms.IdValidationMethodNode(*arg, **kw)[source]

Node to choose a build-in ID number validation method.

class camcops_server.cc_modules.cc_forms.IncludeBlobsNode(*arg, **kw)[source]

Boolean node: should BLOBs be included (for downloads)?

schema_type

alias of colander.Boolean

class camcops_server.cc_modules.cc_forms.LinkingIdNumSelector(*args, **kwargs)[source]

Convenience node: pick a single ID number, with title/description indicating that it’s the ID number to link on.

class camcops_server.cc_modules.cc_forms.LoginForm(request: CamcopsRequest, autocomplete_password: bool = True, **kwargs)[source]

Form to capture login details.

Parameters:autocomplete_password – suggest to the browser that it’s OK to store the password for autocompletion? Note that browsers may ignore this.
class camcops_server.cc_modules.cc_forms.LoginSchema(*arg, **kw)[source]

Schema to capture login details.

class camcops_server.cc_modules.cc_forms.MandatoryDeviceIdSelector(*args, **kwargs)[source]

Mandatory node to select a client device ID.

schema_type

alias of colander.Integer

class camcops_server.cc_modules.cc_forms.MandatoryGroupIdSelectorAdministeredGroups(*args, **kwargs)[source]

Offers a picklist of groups from GROUPS ADMINISTERED BY REQUESTOR. Used by groupadmins: “add user to one of my groups”.

class camcops_server.cc_modules.cc_forms.MandatoryGroupIdSelectorAllGroups(*args, **kwargs)[source]

Offers a picklist of groups from ALL POSSIBLE GROUPS. Used by superusers: “add user to any group”.

class camcops_server.cc_modules.cc_forms.MandatoryGroupIdSelectorAllowedGroups(*args, **kwargs)[source]

Offers a picklist of groups from THOSE THE USER IS ALLOWED TO SEE. Used for task filters.

class camcops_server.cc_modules.cc_forms.MandatoryGroupIdSelectorOtherGroups(*args, **kwargs)[source]

Offers a picklist of groups THAT ARE NOT THE SPECIFIED GROUP (as specified in kw[Binding.GROUP]). Used by superusers: “which other groups can this group see?”

class camcops_server.cc_modules.cc_forms.MandatoryGroupIdSelectorUserGroups(*args, **kwargs)[source]

Offers a picklist of groups from THOSE THE USER IS A MEMBER OF. Used for: “which of your groups do you want to upload into?”

class camcops_server.cc_modules.cc_forms.MandatoryIdNumNode(*arg, **kw)[source]

Mandatory node to capture an ID number type and the associated actual ID number (value).

class camcops_server.cc_modules.cc_forms.MandatoryIdNumValue(*arg, **kw)[source]

Mandatory node to capture an ID number value.

schema_type

alias of colander.Integer

class camcops_server.cc_modules.cc_forms.MandatorySexSelector(*args, **kwargs)[source]

Mandatory node to choose sex.

class camcops_server.cc_modules.cc_forms.MandatoryUserIdSelectorUsersAllowedToSee(*args, **kwargs)[source]

Mandatory node to choose a user, from the users that the requesting user is allowed to see.

schema_type

alias of colander.Integer

class camcops_server.cc_modules.cc_forms.MandatoryWhichIdNumSelector(*args, **kwargs)[source]

Node to enforce the choice of a single ID number type (e.g. “NHS number” or “study Blah ID number”).

class camcops_server.cc_modules.cc_forms.MultiTaskSelector(*args, tracker_tasks_only: bool = False, minimum_number: int = 0, **kwargs)[source]

Node to select multiple task types.

schema_type

alias of colander.Set

class camcops_server.cc_modules.cc_forms.MustChangePasswordNode(*arg, **kw)[source]

Boolean node: must the user change their password?

schema_type

alias of colander.Boolean

class camcops_server.cc_modules.cc_forms.NewPasswordNode(*arg, **kw)[source]

Node to enter a new password.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.OfferBasicDumpForm(request: CamcopsRequest, **kwargs)[source]

Form to offer a basic (TSV/ZIP) data dump.

class camcops_server.cc_modules.cc_forms.OfferBasicDumpSchema(*arg, **kw)[source]

Schema to choose the settings for a basic (TSV/ZIP) data dump.

class camcops_server.cc_modules.cc_forms.OfferDumpManualSchema(*arg, **kw)[source]

Schema to offer the “manual” settings for a data dump (groups, task types).

class camcops_server.cc_modules.cc_forms.OfferSqlDumpForm(request: CamcopsRequest, **kwargs)[source]

Form to choose the settings for an SQL data dump.

class camcops_server.cc_modules.cc_forms.OfferSqlDumpSchema(*arg, **kw)[source]

Schema to choose the settings for an SQL data dump.

class camcops_server.cc_modules.cc_forms.OfferTermsForm(request: CamcopsRequest, agree_button_text: str, **kwargs)[source]

Form to offer terms and ask the user to accept them.

Parameters:agree_button_text – text for the “agree” button
class camcops_server.cc_modules.cc_forms.OfferTermsSchema(*arg, **kw)[source]

Schema to offer terms and ask the user to accept them.

class camcops_server.cc_modules.cc_forms.OldUserPasswordCheck(*arg, **kw)[source]

Schema to capture an old password (for when a password is being changed).

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.OptionalExportRecipientNameSelector(*args, **kwargs)[source]

Optional node to pick an export recipient name from those present in the database.

class camcops_server.cc_modules.cc_forms.OptionalGroupIdSelectorUserGroups(*args, **kwargs)[source]

Offers a picklist of groups from THOSE THE USER IS A MEMBER OF. Used for “which do you want to upload into?”. Optional.

class camcops_server.cc_modules.cc_forms.OptionalIdNumValue(*arg, **kw)[source]

Optional node to capture an ID number value.

static schema_type() → colander.SchemaType[source]

A type representing an integer.

If the colander.null value is passed to the serialize method of this class, the colander.null value will be returned.

The Integer constructor takes an optional argument strict, which if enabled will verify that the number passed to serialize/deserialize is an integer, and not a float that would get truncated.

The subnodes of the colander.SchemaNode that wraps this type are ignored.

class camcops_server.cc_modules.cc_forms.OptionalSexSelector(*args, **kwargs)[source]

Optional node to choose sex.

class camcops_server.cc_modules.cc_forms.OptionalSingleTaskSelector(*args, tracker_tasks_only: bool = False, **kwargs)[source]

Node to pick one task type.

Parameters:tracker_tasks_only – restrict the choices to tasks that offer trackers.
class camcops_server.cc_modules.cc_forms.OptionalUserNameSelector(*args, **kwargs)[source]

Optional node to select a username, from all possible users.

class camcops_server.cc_modules.cc_forms.OptionalWhichIdNumSelector(*args, **kwargs)[source]

Node to select (optionally) an ID number type.

class camcops_server.cc_modules.cc_forms.PolicyNode(*arg, **kw)[source]

Node to capture a CamCOPS ID number policy, and make sure it is syntactically valid.

class camcops_server.cc_modules.cc_forms.RefreshTasksForm(request: CamcopsRequest, **kwargs)[source]

Form for a “refresh tasks” button.

class camcops_server.cc_modules.cc_forms.RefreshTasksSchema(*arg, **kw)[source]

Schema for a “refresh tasks” button.

class camcops_server.cc_modules.cc_forms.ReportOutputTypeSelector(*arg, **kw)[source]

Node to select the output format for a report.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.ReportParamForm(request: CamcopsRequest, schema_class: Type[camcops_server.cc_modules.cc_forms.ReportParamSchema], **kwargs)[source]

Form to view a specific report. Often derived from, to configure the report in more detail.

class camcops_server.cc_modules.cc_forms.ReportParamSchema(*arg, **kw)[source]

Schema to embed a report type (ID) and output format (view type).

class camcops_server.cc_modules.cc_forms.RowsPerPageSelector(*arg, **kw)[source]

Node to select how many rows per page are shown.

schema_type

alias of colander.Integer

class camcops_server.cc_modules.cc_forms.SchemaTests(methodName='runTest')[source]

Unit tests.

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

class camcops_server.cc_modules.cc_forms.ServerPkSelector(*arg, **kw)[source]

Optional node to request an integer, marked as a server PK.

class camcops_server.cc_modules.cc_forms.SetUserUploadGroupForm(request: CamcopsRequest, user: User, **kwargs)[source]

Form to choose the group into which a user uploads.

class camcops_server.cc_modules.cc_forms.SetUserUploadGroupSchema(*arg, **kw)[source]

Schema to choose the group into which a user uploads.

class camcops_server.cc_modules.cc_forms.SimpleSubmitForm(schema_class: Type[colander.Schema], submit_title: str, request: CamcopsRequest, **kwargs)[source]

Form with a simple “submit” button.

Parameters:
class camcops_server.cc_modules.cc_forms.SortTsvByHeadingsNode(*arg, **kw)[source]

Boolean node: sort TSV files by column name?

schema_type

alias of colander.Boolean

class camcops_server.cc_modules.cc_forms.SqliteSelector(*args, **kwargs)[source]

Node to select a way of downloading an SQLite database.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.StartDateSelector(*arg, **kw)[source]

Optional node to select a start date (in UTC).

class camcops_server.cc_modules.cc_forms.StartDateTimeSelector(*arg, **kw)[source]

Optional node to select a start date/time (in UTC).

class camcops_server.cc_modules.cc_forms.StartPendulumSelector(*arg, **kw)[source]

Optional node to select a start date/time.

class camcops_server.cc_modules.cc_forms.TaskTrackerOutputTypeSelector(*arg, **kw)[source]

Node to select the output format for a tracker.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.TasksPerPageForm(request: CamcopsRequest, **kwargs)[source]

Form to edit the number of tasks per page, for the task view.

class camcops_server.cc_modules.cc_forms.TasksPerPageSchema(*arg, **kw)[source]

Schema to edit the number of rows per page, for the task view.

class camcops_server.cc_modules.cc_forms.TextContentsSequence(*args, **kw)[source]

Sequence to capture multiple pieces of text (representing text contents for a task filter).

class camcops_server.cc_modules.cc_forms.UploadingUserSequence(*args, **kw)[source]

Sequence to capture multiple users (for task filters: “uploaded by one of the following users…”).

class camcops_server.cc_modules.cc_forms.UserGroupPermissionsFullSchema(*arg, **kw)[source]

Edit group-specific permissions for a user. For superusers; includes the option to make the user a groupadmin.

class camcops_server.cc_modules.cc_forms.UserGroupPermissionsGroupAdminSchema(*arg, **kw)[source]

Edit group-specific permissions for a user. For group administrators.

class camcops_server.cc_modules.cc_forms.UsernameNode(*arg, **kw)[source]

Node to enter a username.

schema_type

alias of colander.String

class camcops_server.cc_modules.cc_forms.ViaIndexSelector(*args, **kwargs)[source]

Node to choose whether we use the server index or not. Default is true.

class camcops_server.cc_modules.cc_forms.ViewDdlForm(request: CamcopsRequest, **kwargs)[source]

Form to choose how to view DDL (and then view it).

class camcops_server.cc_modules.cc_forms.ViewDdlSchema(*arg, **kw)[source]

Schema to choose how to view DDL.

camcops_server.cc_modules.cc_forms.add_css_class(kwargs: Dict[str, Any], extra_classes: str, param_name: str = 'css_class') → None[source]

Modifies a kwargs dictionary to add a CSS class to the css_class parameter.

Parameters:
  • kwargs – a dictionary
  • extra_classes – CSS classes to add (as a space-separated string)
  • param_name – parameter name to modify; by default, “css_class”
camcops_server.cc_modules.cc_forms.make_node_widget_horizontal(node: colander.SchemaNode) → None[source]

Applies Bootstrap “form-inline” styling to the schema node’s widget.

camcops_server.cc_modules.cc_forms.make_widget_horizontal(widget: deform.widget.Widget) → None[source]

Applies Bootstrap “form-inline” styling to the widget.