14.3.18. crate_anon.crateweb.consent.forms

crate_anon/crateweb/consent/forms.py


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

This file is part of CRATE.

CRATE 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.

CRATE 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 CRATE. If not, see <https://www.gnu.org/licenses/>.


Django forms for the consent-to-contact system.

class crate_anon.crateweb.consent.forms.AbstractContactRequestForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Base class for contact requets.

clean() None[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

property media

Return all media required to render the widgets on this form.

class crate_anon.crateweb.consent.forms.ClinicianResponseForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Form for clinicians to respond to a contact request.

property media

Return all media required to render the widgets on this form.

class crate_anon.crateweb.consent.forms.ClinicianSubmitContactRequestForm(*args, dbinfo: SingleResearchDatabase, email_addr: str, title: str, firstname: str, lastname: str, **kwargs)[source]

Form for clinician to request that a patient of their’s gets contacted about a study.

__init__(*args, dbinfo: SingleResearchDatabase, email_addr: str, title: str, firstname: str, lastname: str, **kwargs) None[source]
property media

Return all media required to render the widgets on this form.

class crate_anon.crateweb.consent.forms.ResearcherSubmitContactRequestForm(*args, user: auth.User, dbinfo: SingleResearchDatabase, **kwargs)[source]

Form for researchers to submit a contact request for their own studies.

__init__(*args, user: auth.User, dbinfo: SingleResearchDatabase, **kwargs) None[source]
property media

Return all media required to render the widgets on this form.

class crate_anon.crateweb.consent.forms.SingleNhsNumberForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Form to capture an NHS number.

property media

Return all media required to render the widgets on this form.

class crate_anon.crateweb.consent.forms.SuperuserSubmitContactRequestForm(*args, dbinfo: SingleResearchDatabase, **kwargs)[source]

Form for superusers (the RDBM) to submit a contact request.

__init__(*args, dbinfo: SingleResearchDatabase, **kwargs) None[source]
property media

Return all media required to render the widgets on this form.

class crate_anon.crateweb.consent.forms.TeamRepAdminForm(*args, **kwargs)[source]

Custom form for the RDBM to edit team reps.

The purposes is so that we only ask the database for team information at the point of use (and not e.g. to run database migrations from the command line!).

__init__(*args, **kwargs) None[source]

Set the possible teams.

property media

Return all media required to render the widgets on this form.