sharpie.webserver.accounts.models

Functions

default_research_team()

Classes

Consent(*args, **kwargs)

Model to formulate user consent for research participation.

Participant(*args, **kwargs)

Model to track participants in the study.

sharpie.webserver.accounts.models.default_research_team()
class sharpie.webserver.accounts.models.Consent(*args, **kwargs)

Model to formulate user consent for research participation.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • name (CharField) – Name

  • explanation_text (TextField) – Explanation text

  • research_team (JSONField) – Research team

  • ethical_guidelines (TextField) – Ethical guidelines

  • created_at (DateTimeField) – Created at

Reverse relationships:

Parameters:

participants (Reverse ForeignKey from Participant) – All participants of this consent (related name of consent)

name

Type: CharField

Name

explanation_text

Type: TextField

Explanation text

research_team

Type: JSONField

Research team

ethical_guidelines

Type: TextField

Ethical guidelines

created_at

Type: DateTimeField

Created at

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

delete(using=Ellipsis, keep_parents=Ellipsis)
exception DoesNotExist
exception MultipleObjectsReturned
get_next_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=True, **kwargs)

Finds next instance based on created_at. See get_next_by_FOO() for more information.

get_previous_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=False, **kwargs)

Finds previous instance based on created_at. See get_previous_by_FOO() for more information.

id

Type: BigAutoField

Primary key: ID

objects = <django.db.models.Manager object>
participants

Type: Reverse ForeignKey from Participant

All participants of this consent (related name of consent)

class sharpie.webserver.accounts.models.Participant(*args, **kwargs)

Model to track participants in the study.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • external_id (CharField) – External id

  • demographics (JSONField) – Demographics

  • agreed_at (DateTimeField) – Agreed at

  • withdrawn_at (DateTimeField) – Withdrawn at

  • created_at (DateTimeField) – Created at

  • last_modified (DateTimeField) – Last modified

Relationship fields:

Parameters:
  • user (OneToOneField to User) – User (related name: participant)

  • consent (ForeignKey to Consent) – Consent (related name: participants)

Reverse relationships:

Parameters:

sessions (Reverse ManyToManyField from Session) – All sessions of this participant (related name of participants)

user

Type: OneToOneField to User

User (related name: participant)

external_id

Type: CharField

External id

demographics

Type: JSONField

Demographics

consent

Type: ForeignKey to Consent

Consent (related name: participants)

agreed_at

Type: DateTimeField

Agreed at

withdrawn_at

Type: DateTimeField

Withdrawn at

created_at

Type: DateTimeField

Created at

last_modified

Type: DateTimeField

Last modified

exception DoesNotExist
exception MultipleObjectsReturned
consent_id

Internal field, use consent instead.

get_next_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=True, **kwargs)

Finds next instance based on created_at. See get_next_by_FOO() for more information.

get_next_by_last_modified(*, field=<django.db.models.DateTimeField: last_modified>, is_next=True, **kwargs)

Finds next instance based on last_modified. See get_next_by_FOO() for more information.

get_previous_by_created_at(*, field=<django.db.models.DateTimeField: created_at>, is_next=False, **kwargs)

Finds previous instance based on created_at. See get_previous_by_FOO() for more information.

get_previous_by_last_modified(*, field=<django.db.models.DateTimeField: last_modified>, is_next=False, **kwargs)

Finds previous instance based on last_modified. See get_previous_by_FOO() for more information.

id

Type: BigAutoField

Primary key: ID

objects = <django.db.models.Manager object>
sessions

Type: Reverse ManyToManyField from Session

All sessions of this participant (related name of participants)

user_id

Internal field, use user instead.